The Euler-Lagrange first integral

237 Views Asked by At

How to calculate $\frac{d\phi}{dz}$ from following equation:

$$A\frac{d^2\phi}{dz^2}+\cos(\phi)\sin(\phi)=0,$$ where $A$ is a constant?

2

There are 2 best solutions below

0
On

Mathematica can solve the ode in general

sol = DSolve[A ϕ''[z] == -Cos[ϕ[z]] Sin[ϕ[z]], ϕ,z];
Simplify[ϕ'[z] /. sol]

but there are two branches of solution ±ϕ[z]!

6
On

The trick is to integrate the equation once; up to an integration constant, you will get

Integrate[A D[ϕ[z], z, z] + Cos[z] Sin[z], z] == C

$A \phi '(z)-\frac{\cos ^2(z)}{2}=C$

Edit

I overlooked the equation should be

A D[ϕ[z], z, z] + Cos[ϕ[z]] Sin[ϕ[z]] == 0

No problem. Essentially, the same trick works after multiplication with D[ϕ[z], z]:

Integrate[A D[ϕ[z], z, z] D[ϕ[z], z] + Cos[ϕ[z]] Sin[ϕ[z]] D[ϕ[z], z], z] == C
Solve[eq, D[ϕ[z], z]]

$\frac{1}{2} A \phi '(z)^2-\frac{1}{2} \cos ^2(\phi (z))=C$

$\left\{\left\{\phi '(z)\to -\frac{\sqrt{2 C+\cos ^2(\phi (z))}}{\sqrt{A}}\right\},\left\{\phi '(z)\to \frac{\sqrt{2 C+\cos ^2(\phi (z))}}{\sqrt{A}}\right\}\right\}$