16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.3. VARIATIONAL CALCULUS MODELS 197<br />

> sol:=dsolve(ode,y(x)); #implicit solution<br />

q<br />

y(x) ¡ K1<br />

sol := x +<br />

2 y(x) 2<br />

¡<br />

K1<br />

1<br />

0p<br />

K1 B<br />

arctanB<br />

@<br />

2<br />

2<br />

μ<br />

y(x) ¡ 1 1<br />

2 K1 2<br />

<br />

q<br />

y(x) ¡ K1 2 y(x) 2<br />

1<br />

C<br />

A<br />

p<br />

K1 K1 2<br />

¡ C1 =0;<br />

q<br />

y(x) ¡ K1<br />

x ¡<br />

2 y(x) 2 0p<br />

K1 B<br />

arctan B<br />

@<br />

+ 1<br />

K1 2<br />

2<br />

μ<br />

y(x) ¡ 1 1<br />

2 K1 2<br />

<br />

q<br />

y(x) ¡ K1 2 y(x) 2<br />

1<br />

C<br />

A<br />

p<br />

K1 K1 2<br />

¡ C1 =0<br />

A formidable-looking implicit solution has been produced, with two forms<br />

present. It turns out that we must select the form having the positive square<br />

root (the ¯rst solution for this particular run). For later convenience, I will also<br />

replace the awkward constant symbols K1 and C1 with1= p A and B.<br />

> ans:=subs(fK[1]=1/sqrt(A),_C1=Bg,sol[1]); #select + root<br />

ans := x + p r<br />

A y(x) ¡ y(x)2<br />

0r<br />

1 A<br />

p B (y(x) ¡<br />

A arctan B A 2<br />

@<br />

1<br />

¡<br />

A 2<br />

)<br />

r<br />

y(x) ¡ y(x)2<br />

1<br />

C<br />

A<br />

r<br />

A<br />

¡ B =0<br />

1<br />

A<br />

To proceed any further with the implicit answer, its square-root structure suggests<br />

a trigonometric substitution of the form y = A sin 2 μ,whereμisan angular<br />

parameter not connected to any geometrical feature in our picture. Here A and<br />

B are assumed to be positive, as are sinμ and cos μ as well.<br />

> assume(A>0,B>0,sin(theta)>0,cos(theta)>0):<br />

> Y:=y(x)=A*sin(theta)^2;<br />

Y := y(x) =A sin(μ) 2<br />

Then Y is substituted into the answer, and simpli¯ed with the trig option.<br />

> sol1:=simplify(subs(Y,ans),trig);<br />

sol1 := x + A sin(μ)cos(μ)+ 1<br />

μ<br />

1 ¡1+2cos(μ)<br />

A arctan<br />

2 2<br />

2 <br />

¡ B =0<br />

sin(μ)cos(μ)<br />

Then we solve sol1 for x and combine with respect to trig terms.<br />

> x:=combine(solve(sol1,x),trig);<br />

x := ¡ 1<br />

μ <br />

1<br />

cos(2 μ)<br />

A sin(2 μ) ¡ A arctan<br />

+ B<br />

2 2 sin(2 μ)<br />

So, now we have expressions for the coordinates x and y of our sought-after<br />

curve in terms of A, B, andμ. If A and B can be found and the range of μ

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!