I would greatly appreciate help solving this system in Mathematica.


The answer:

\begin{aligned}\tan\theta_{1}&=\frac{Cr_{s}}{({r_{s}}^{2}\cos^{2}\phi_{1}+\sin^{2}\phi_{1})^{\frac{1}{2}}},\\\tan\phi_{1}&=r_{s}\tan\left(\frac{2\pi t}{T}+\kappa\right),\end{aligned} Where T:


Here $G, r_s$ are constants and $C, k$ are integration constants.

Clear[theta, phi, t, G, rS]

eq1 = D[theta[t],t] == (G (rS^2 - 1))/(4 (rS^2 + 1)) Sin[2 theta[t]] Sin[2 phi[t]];
eq2 = D[phi[t], t] ==  G/(rS^2 + 1) (rS^2 Cos[phi[t]]^2 +Sin[phi[t]]^2);

solutions = DSolve[{eq1, eq2}, {theta[t], phi[t]}, t];

thetaSol = theta[t] /. solutions[[1]];
phiSol = phi[t] /. solutions[[1]];

simplifiedThetaSol = Simplify[thetaSol]
simplifiedPhiSol = Simplify[phiSol]

I attached this simple code I wrote. The equation I am looking is initial condition dependent (Later I want to do some statistical analysis on this dependency, therefore I need analytical expression.). I wanted to see if MMA can handle this type of equations to reduce work. It gave good result for $\phi$ as it is straightforward to integrate. But once you plug it back to $\theta$ and perform integration it fails. I also tried other symbolic solvers without results.

  • 2
    $\begingroup$ What did you try so far, please show some code $\endgroup$ Aug 9 at 17:42
  • $\begingroup$ I added some additional Information if it helps. $\endgroup$ Aug 9 at 19:59
  • $\begingroup$ Where the "answers" come from? $\endgroup$ Aug 9 at 21:02
  • 1
    $\begingroup$ it works in V 13.3. The second solution is implicit. May be with assumption it can be fully solved as explicit. screen shot !Mathematica graphics $\endgroup$
    – Nasser
    Aug 9 at 23:02
  • $\begingroup$ @UlrichNeumann the answer that I use comes from link. $\endgroup$ Aug 10 at 2:11

1 Answer 1



You might solve it explicit in two steps as follows:

First we solve eq2which only dependes on phi[t]

solphi = DSolve[ eq2 , phi[t] , t]
(*{{phi[t] -> ArcTan[rS Tan[2 rS ((G t)/(2 (1 + rS^2)) + C[1])]]}}*)
Tan[phi[t]] -> ( Tan[phi[t]] /. solphi)

![enter image description here

eq1 is solvable if we transform TrigExpand[eq1] first

soltheta=DSolve[TrigExpand[eq1] /. solphi[[1]], theta, t];
Tan[theta[t]] -> (Tan[theta[t]] /. soltheta)

enter image description here

Hope it helps!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.