ODE No. 78

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

\[ a \sin (\alpha y(x)+\beta x)+b+y'(x)=0 \] Mathematica : cpu = 0.86995 (sec), leaf count = 1317

\[\left \{\left \{y(x)\to \frac {2 \tan ^{-1}\left (\frac {\frac {a^2 \sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )} \tan \left (\frac {1}{2} \left (\frac {a^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {b^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {a^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {b^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {2 b \beta x \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {2 b \beta c_1 \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {\beta ^2 x}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {\beta ^2 c_1}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}\right )\right ) \alpha ^2}{(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}-\frac {b^2 \sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )} \tan \left (\frac {1}{2} \left (\frac {a^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {b^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {a^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {b^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {2 b \beta x \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {2 b \beta c_1 \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {\beta ^2 x}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {\beta ^2 c_1}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}\right )\right ) \alpha ^2}{(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}-a \alpha +\frac {2 b \beta \sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )} \tan \left (\frac {1}{2} \left (\frac {a^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {b^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {a^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {b^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {2 b \beta x \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {2 b \beta c_1 \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {\beta ^2 x}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {\beta ^2 c_1}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}\right )\right ) \alpha }{(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}-\frac {\beta ^2 \sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )} \tan \left (\frac {1}{2} \left (\frac {a^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {b^2 x \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {a^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {b^2 c_1 \alpha ^2}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {2 b \beta x \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {2 b \beta c_1 \alpha }{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}-\frac {\beta ^2 x}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}+\frac {\beta ^2 c_1}{\sqrt {-(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}\right )\right )}{(a \alpha +b \alpha -\beta ) (a \alpha -b \alpha +\beta )}}{\alpha b-\beta }\right )-\beta x}{\alpha }\right \}\right \}\] Maple : cpu = 2.305 (sec), leaf count = 89

\[ \left \{ y \left ( x \right ) ={\frac {1}{\alpha } \left ( -\beta \,x+2\,\arctan \left ( {\frac {-\tan \left ( 1/2\,\sqrt { \left ( -{a}^{2}+{b}^{2} \right ) {\alpha }^{2}-2\,\alpha \,b\beta +{\beta }^{2}} \left ( x-{\it \_C1} \right ) \right ) \sqrt { \left ( -{a}^{2}+{b}^{2} \right ) {\alpha }^{2}-2\,\alpha \,b\beta +{\beta }^{2}}-a\alpha }{b\alpha -\beta }} \right ) \right ) } \right \} \]

Hand solution

\[ y^{\prime }=-a\sin \left ( \alpha y+\beta x\right ) -b \]

This is separable after transformation of \(u=\alpha y+\beta x\), hence \(u^{\prime }=\alpha y^{\prime }+\beta \) or \(y^{\prime }=\frac {1}{\alpha }\left ( u^{\prime }-\beta \right ) \). Therefore the above becomes\begin {align} \frac {1}{\alpha }\left ( u^{\prime }-\beta \right ) & =-a\sin \left ( u\right ) -b\nonumber \\ u^{\prime } & =-\alpha \left ( a\sin \left ( u\right ) +b\right ) +\beta \nonumber \\ \frac {du}{\beta -\alpha \left ( a\sin \left ( u\right ) +b\right ) } & =dx\tag {1} \end {align}

Using half angle tan transformation where \(\tan \left ( \frac {u}{2}\right ) =t,\sin \left ( u\right ) =\frac {2t}{t^{2}+1},du=\frac {2}{1+t^{2}}dt\) then\begin {align*} \int \frac {du}{\beta -\alpha \left ( a\sin \left ( u\right ) +b\right ) } & =\int \frac {2}{1+t^{2}}\frac {dt}{\beta -\alpha \left ( a\frac {2t}{t^{2}+1}+b\right ) }\\ & =2\int \frac {dt}{\beta \left ( t^{2}+1\right ) -\alpha \left ( a2t+b\left ( t^{2}+1\right ) \right ) }\\ & =2\int \frac {dt}{t\beta ^{2}+\beta -\left ( \alpha a2t+t^{2}\alpha b+\alpha b\right ) }\\ & =2\int \frac {dt}{\left ( \beta -\alpha b\right ) \left ( \frac {t\beta ^{2}-\alpha a2t-t^{2}\alpha b}{\left ( \beta -\alpha b\right ) }+1\right ) }\\ & =\frac {2}{\left ( \beta -\alpha b\right ) }\int \frac {dt}{\frac {t\beta ^{2}-\alpha a2t-t^{2}\alpha b}{\left ( \beta -\alpha b\right ) }+1}\\ & =\frac {2}{\left ( \beta -\alpha b\right ) }\frac {-\left ( \alpha b-\beta \right ) }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\tanh ^{-1}\left ( \frac {\left ( t+\frac {a\alpha }{b\alpha -\beta }\right ) \left ( b\alpha -\beta \right ) }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\right ) \\ & =\frac {2}{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\tanh ^{-1}\left ( \frac {t\left ( b\alpha -\beta \right ) +a\alpha }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\right ) \end {align*}

But \(t=\tan \left ( \frac {u}{2}\right ) \) therefore\[ \int \frac {du}{\beta -\alpha \left ( a\sin \left ( u\right ) +b\right ) }=\frac {2}{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\tanh ^{-1}\left ( \frac {\tan \left ( \frac {u}{2}\right ) \left ( b\alpha -\beta \right ) +a\alpha }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\right ) \] But \(u=\alpha y+\beta x\), and the above becomes\[ \int \frac {du}{\beta -\alpha \left ( a\sin \left ( u\right ) +b\right ) }=\frac {2\tanh ^{-1}\left ( \frac {\tan \left ( \frac {\alpha y+\beta x}{2}\right ) \left ( b\alpha -\beta \right ) +a\alpha }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\right ) }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\] Back to (1), therefore after integrating both sides\[ \frac {2\tanh ^{-1}\left ( \frac {\tan \left ( \frac {\alpha y+\beta x}{2}\right ) \left ( b\alpha -\beta \right ) +a\alpha }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}\right ) }{\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }}=x+C \]

Let \[ A=\sqrt {\alpha ^{2}a^{2}-\left ( \alpha ^{2}b^{2}+\beta ^{2}-2\alpha b\beta \right ) }\] Then

\begin {align*} \tanh ^{-1}\left ( \frac {\tan \left ( \frac {\alpha y+\beta x}{2}\right ) \left ( b\alpha -\beta \right ) +a\alpha }{A}\right ) & =\frac {1}{2}A\left ( x+C\right ) \\ \frac {\tan \left ( \frac {\alpha y+\beta x}{2}\right ) \left ( b\alpha -\beta \right ) +a\alpha }{A} & =\tanh \left ( \frac {1}{2}A\left ( x+C\right ) \right ) \\ \tan \left ( \frac {\alpha y+\beta x}{2}\right ) \left ( b\alpha -\beta \right ) +a\alpha & =A\tanh \left ( \frac {1}{2}A\left ( x+C\right ) \right ) \\ \tan \left ( \frac {\alpha y+\beta x}{2}\right ) & =\frac {A}{\left ( b\alpha -\beta \right ) }\tanh \left ( \frac {1}{2}A\left ( x+C\right ) \right ) -\frac {a\alpha }{\left ( b\alpha -\beta \right ) }\\ \frac {\alpha y+\beta x}{2} & =\arctan \left ( \frac {A}{\left ( b\alpha -\beta \right ) }\tanh \left ( \frac {1}{2}A\left ( x+C\right ) \right ) -\frac {a\alpha }{\left ( b\alpha -\beta \right ) }\right ) \\ y & =\frac {2}{\alpha }\arctan \left ( \frac {A}{\left ( b\alpha -\beta \right ) }\tanh \left ( \frac {1}{2}A\left ( x+C\right ) \right ) -\frac {a\alpha }{\left ( b\alpha -\beta \right ) }\right ) -\frac {\beta x}{\alpha } \end {align*}

Verification

ode:=diff(y(x),x)=-a*sin(alpha*y(x)+beta*x)-b; 
A0:=sqrt(alpha^2*a^2-(alpha^2*b^2+beta^2-2*alpha*b*beta)); 
B0:=(alpha*b-beta); 
my_sol:=2/alpha*arctan(A0/B0*tanh((1/2)*A0*(x+_C1))-a*alpha/(B0))-beta*x/alpha; 
odetest(y(x)=my_sol,ode); 
0