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?
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?
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$
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\}$
Mathematica can solve the ode in general
but there are two branches of solution
±ϕ[z]!