## 2670 Reputation

16 years, 165 days

Dr. Robert J. Lopez, Emeritus Professor of Mathematics at the Rose-Hulman Institute of Technology in Terre Haute, Indiana, USA, is an award winning educator in mathematics and is the author of several books including Advanced Engineering Mathematics (Addison-Wesley 2001). For over two decades, Dr. Lopez has also been a visionary figure in the introduction of Maplesoft technology into undergraduate education. Dr. Lopez earned his Ph.D. in mathematics from Purdue University, his MS from the University of Missouri - Rolla, and his BA from Marist College. He has held academic appointments at Rose-Hulman (1985-2003), Memorial University of Newfoundland (1973-1985), and the University of Nebraska - Lincoln (1970-1973). His publication and research history includes manuscripts and papers in a variety of pure and applied mathematics topics. He has received numerous awards for outstanding scholarship and teaching.

## Student MultivariateCalculus Package...

with(Student:-MultivariateCalculus):

L1:=GetRepresentation(Line([1,0,-2],<1,1,2>,parameter=t),form=combined_vector);

L2:=GetRepresentation(Line([k*s+4,2*s,3*s],parameter=s),form=combined_vector);

solve(Equate(L1,L2));

This approach sets up and solves three equations in the three unknowns k, s, t.  Perhaps a bit more intuitive?

## Include the dependent variable...

I think the error message indicates that you used y, not y(x) (or the equivalents) in your ODE. All instances of the dependent variable should occur with the independent variable included.

Typeset math allows the use of just the name of the dependent variable, but even there, one can get into difficulties cutting corners.

## getdata...

Consider the following commands.

interface(rtablesize=100): # so large matrices are fully displayed

q:=plots:-implicitplot(eqn,t=-50..50,y=-200..200): # hyperbola, so there are two branches
Q:=plottools:-getdata(q):

Q[1][3]  # data Maple used for first branch

Q[2][3]  # data Maple used for second branch

Alternatively, you could solve for y explicitly. There would be two branches, y1(t) and y2(t). Then, you could evaluate y1 and y2 at any values of t that you found convenient, and the corresponding values of y would be determined.

## A few hints...

First, maple sees the symbol u as a name, not as a function. If u is to be a function of x, y, and z, then you need to enter it as u(x,y,z) to obtain the functional dependence you claim.

Then, the name on the left, u__0, which will look like a subscripted u, needs to be followed by an assignment operator, not merely an = sign. The = sign is used to form equations, Use := (colon equal) as the assignment operator.

Third, if you can apply diff to u__0, but display only an = sign in your post, but yet claim that Maple produced derivatives of some of the terms on the right, then you did more in your worksheet than you reported here. If, indeed, you did what you reported here, then applying diff to u__0 would result in zero because u__0 would not stand for the expression on the right of your = sign. It wouldn't be assigned anything.

In the future, it would be better to upload the whole worksheet via the green arrow in the toolbar at the top of the posting window. Then, we could see exactly what it is that you did, and not have to guess.

## Some remarks...

Not sure if you want to compute with the result or merely display it. I think you might have trouble trying to compute with it.

Maple's differentiation operators assume that the order of partial differentiation is immaterial, which is mathematically the case for funtions that are sufficiently differentiable. So, even if you could assemble the operator and apply it, Maple's treatment of differentiation might not respect the order you are trying to impose.

For example, (D[]1,2]*D[2,1])(f(x,y)) = D[1,2](f(x,y))^2

However, I'm not sure this is the last word on the matter. If someone else has a way to do this, I'd be pleased to know.

## Variation of Parameters...

Maple uses the Variation of Parameters formula to obtain the particular solution. The integrals in this formula can, and do often, return terms that are in the fundamental set of solutions, that is, are homogeneous solutions. There is, as far as I know, no way to filter these out. This has plagued me since I started using Maple in my DE classes as early as 1989. If there is a way to filter these terms from the particular solution, I think we would both like to know.

The best I can suggest is a collect on the general solution, collecting with respect to sin(2*t) (here).

Does anyone have a better solution?

## alias...

Google "Blum Blum Shub" and you will find that this is actually the name used for the algorithm attributed to its authors.

In Maple, execute the alias command alias(BBS=BlumBlumShub), after which you can replace the long name with BBS in the rest of the session. If you want that shortcut to load every time you launch Maple, put it into your .ini file.

## Roots command...

If the equation is assigned to the name q, then

Student:-Calculus1:-Roots(q,K[1]=-1..1,numeric) returns three solutions: [-4.264348112*10^(-13), -2.539955697*10^(-13), .9832314847]

The solve command in Maple need not return all analytic solutions. The fsolve command, which computes numerically, can be made to find solutions in specified intervals. It would have found the positive solution you sought. The Roots command in the Student Calculus1 package will return all solutions in a specified interval, and can function either analytically or numerically. There are other root-finding tools in Maple, but the ones sketched here suffice for your question.

## phaseportrait...

Look at the phaseportrait command in the DEtools package. In particular, look at the last example on the help page for this command.

## Outer integral might not have antideriva...

There are many double integrals for which the inner integral can be evaluated (not "solved") in closed form. It might then not be possible to evaluate te outer integral of this result in closed form. If all parameters are numeric, it should then be possible to evaluate the outer integral numerically. It doesn't take much to be faced with this challenge - a square root of a sum of squares is usually what makes this happen for me.

## MultiInt...

The MultiInt command in the Student MultivariateCalculus package will do what you want.

This command has three outputs: output=value, output=integral, output=steps. The third option will evaluate the integral in a stepwise fashion.

## Roots command...

The Roots command in the Student Calculus1 package is the ideal tool for this. If this package is installed, the Roots functionality will be available in the Context Menu. I have separated the equation from the Roots command for convenience.

q:=7*cos(2*t)=7*cos(t)^2-5;
Student:-Calculus1:-Roots(q,t=0..2*Pi);

[arccos((1/7)*sqrt(14)), Pi-arccos((1/7)*sqrt(14)), Pi+arccos((1/7)*sqrt(14)), 2*Pi-arccos((1/7)*sqrt(14))]

## Using IntegrationTools...

Here is a way of generating an asymptotic expansion by repeated integration by parts using Maple to do most of the work. It does not use the recipe provided by the OP, but the following structure is used in my Advanced Engineering Math ebook more than once.

with(IntegrationTools):
m0:=Int(exp(-x*t)/sqrt(t^2+t),t=1..infinity);
for k from 1 to 5 do
temp:=Parts(m||(k-1),remove(has,GetIntegrand(m||(k-1)),exp));
m||k:=eval(temp) assuming x>0;
print(m||k);
od:

The Parts command needs only an expression containing an unevaluated integral, and the factor that is to be differentiated in the integration-by-parts formula. The GetIntegrand command then extracts the integrand of the unevaluated integral that results. The remove command removes the exponential from that integrand, which leaves the next term that is to be fed to the Parts command as the factor that is to be differentiated. In order for the limits of integration to be evaluated, Maple needs to know that x is, for example, positive. So, the integration by parts is done first, then the limits are evaluated under the assumption that x>0. A simplify here brings everything into one fraction, not a useful step. The eval seems to force Maple to evaluate the limits under the assumption. Finally, m||k produces the names m1, m2, etc.

## PlotVector command...

I find that the PlotVector command in either of the VectorCalculus packages is more convenient than the use of either of the arrow commands.

If q is the matrix whose columns are the vectors to be graphed, then

L:=[seq(q[1..-1,k],k=1..op([1,2],q))];

is a list of each such vector. (This is essentially the code used by the Context Menu to split a matrix into columns.

The command op([1,2],q) counts the number of columns in the matrix q. There are other ways to determine this number.)

plots:-display(seq(VectorCalculus:-PlotVector(L[k]),k=1..10),insequence=true)

## Use Physics Vectors package...

with(Physics:-Vectors):

Setup(mathematicalnotation=true):

Typesetting[Settings](typesetdot=true):

Typesetting[Suppress]([r(t), _rho(t), phi(t), _phi(t)]):

R:=r(t)*_rho(t); (Note my use of r(t) for the radial component to avoid confusion with the name of the basis vector.)

diff(R,t)

The Suppress command suppresses the display of the independent variable t. If this is all done with typeset math, then you get exactly the textbook version of all the notation.

The attached worksheet shows what this all looks like and how to make it happen.Physics_Notation.mw

 (1)

=

=

To jump up on top of R, press Control+Shift+", then type a period. Use the font-control icons in the toolbar to change R to R.