11.6 problem 18.1 (vi)

Internal problem ID [12058]
Internal file name [OUTPUT/10711_Sunday_September_03_2023_12_37_01_PM_62615434/index.tex]

Book: AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section: Chapter 18, The variation of constants formula. Exercises page 168
Problem number: 18.1 (vi).
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "reduction_of_order"

Maple gives the following as the ode type

[[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {\left (\tan \left (x \right )^{2}-1\right ) y^{\prime \prime }-4 y^{\prime } \tan \left (x \right )^{3}+2 y \sec \left (x \right )^{4}=\left (\tan \left (x \right )^{2}-1\right ) \left (1-2 \sin \left (x \right )^{2}\right )} \] Given that one solution of the ode is \begin {align*} y_1 &= \sec \left (x \right )^{2} \end {align*}

This is second order nonhomogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = f(x) \] Where \(A=-2+\sec \left (x \right )^{2}, B=-4 \tan \left (x \right )^{3}, C=2 \sec \left (x \right )^{4}, f(x)=-\sec \left (x \right )^{2} \left (2 \cos \left (x \right )^{2}-1\right )^{2}\). Let the solution be \[ y = y_h + y_p \] Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the inhomogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to \[ y^{\prime \prime } \left (-2+\sec \left (x \right )^{2}\right )-4 y^{\prime } \tan \left (x \right )^{3}+2 y \sec \left (x \right )^{4} = 0 \] Given one basis solution \(y_{1}\left (x \right )\), then the second basis solution is given by \[ y_{2}\left (x \right ) = y_{1} \left (\int \frac {{\mathrm e}^{-\left (\int p d x \right )}}{y_{1}^{2}}d x \right ) \] Where \(p(x)\) is the coefficient of \(y^{\prime }\) when the ode is written in the normal form \[ y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y = f \left (x \right ) \] Looking at the ode to solve shows that \[ p \left (x \right ) = -\frac {4 \tan \left (x \right )^{3}}{-2+\sec \left (x \right )^{2}} \] Therefore \begin{align*} y_{2}\left (x \right ) &= \sec \left (x \right )^{2} \left (\int \frac {{\mathrm e}^{-\left (\int -\frac {4 \tan \left (x \right )^{3}}{-2+\sec \left (x \right )^{2}}d x \right )}}{\sec \left (x \right )^{4}}d x \right ) \\ y_{2}\left (x \right ) &= \sec \left (x \right )^{2} \int \frac {{\mathrm e}^{\ln \left (2 \cos \left (x \right )^{2}-1\right )-4 \ln \left (\cos \left (x \right )\right )}}{\sec \left (x \right )^{4}} , dx \\ y_{2}\left (x \right ) &= \sec \left (x \right )^{2} \left (\int \cos \left (2 x \right )d x \right ) \\ y_{2}\left (x \right ) &= \frac {\sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \\ \end{align*} Hence the solution is \begin{align*} y &= c_{1} y_{1}\left (x \right )+c_{2} y_{2}\left (x \right ) \\ &= \sec \left (x \right )^{2} c_{1} +\frac {c_{2} \sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \\ \end{align*} Therefore the homogeneous solution \(y_h\) is \[ y_h = \sec \left (x \right )^{2} c_{1} +\frac {c_{2} \sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \] The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let \begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation} Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as \begin{align*} y_1 &= \sec \left (x \right )^{2} \\ y_2 &= \frac {\sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \\ \end{align*} In the Variation of parameters \(u_1,u_2\) are found using \begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*} Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence \[ W = \begin {vmatrix} \sec \left (x \right )^{2} & \frac {\sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \\ \frac {d}{dx}\left (\sec \left (x \right )^{2}\right ) & \frac {d}{dx}\left (\frac {\sec \left (x \right )^{2} \sin \left (2 x \right )}{2}\right ) \end {vmatrix} \] Which gives \[ W = \begin {vmatrix} \sec \left (x \right )^{2} & \frac {\sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \\ 2 \tan \left (x \right ) \sec \left (x \right )^{2} & \sec \left (x \right )^{2} \sin \left (2 x \right ) \tan \left (x \right )+\cos \left (2 x \right ) \sec \left (x \right )^{2} \end {vmatrix} \] Therefore \[ W = \left (\sec \left (x \right )^{2}\right )\left (\sec \left (x \right )^{2} \sin \left (2 x \right ) \tan \left (x \right )+\cos \left (2 x \right ) \sec \left (x \right )^{2}\right ) - \left (\frac {\sec \left (x \right )^{2} \sin \left (2 x \right )}{2}\right )\left (2 \tan \left (x \right ) \sec \left (x \right )^{2}\right ) \] Which simplifies to \[ W = \sec \left (x \right )^{4} \cos \left (2 x \right ) \] Which simplifies to \[ W = \sec \left (x \right )^{4} \cos \left (2 x \right ) \] Therefore Eq. (2) becomes \[ u_1 = -\int \frac {-\frac {\sec \left (x \right )^{4} \sin \left (2 x \right ) \left (2 \cos \left (x \right )^{2}-1\right )^{2}}{2}}{\left (-2+\sec \left (x \right )^{2}\right ) \sec \left (x \right )^{4} \cos \left (2 x \right )}\,dx \] Which simplifies to \[ u_1 = - \int \cos \left (x \right )^{3} \sin \left (x \right )d x \] Hence \[ u_1 = \frac {\cos \left (x \right )^{4}}{4} \] And Eq. (3) becomes \[ u_2 = \int \frac {-\sec \left (x \right )^{4} \left (2 \cos \left (x \right )^{2}-1\right )^{2}}{\left (-2+\sec \left (x \right )^{2}\right ) \sec \left (x \right )^{4} \cos \left (2 x \right )}\,dx \] Which simplifies to \[ u_2 = \int \sec \left (2 x \right ) \cos \left (x \right )^{2} \left (2 \cos \left (x \right )^{2}-1\right )d x \] Hence \[ u_2 = \frac {\tan \left (x \right )}{2+2 \tan \left (x \right )^{2}}+\frac {x}{2} \] Which simplifies to \begin{align*} u_1 &= \frac {\cos \left (x \right )^{4}}{4} \\ u_2 &= \frac {\sin \left (2 x \right )}{4}+\frac {x}{2} \\ \end{align*} Therefore the particular solution, from equation (1) is \[ y_p(x) = \frac {\sec \left (x \right )^{2} \cos \left (x \right )^{4}}{4}+\frac {\left (\frac {\sin \left (2 x \right )}{4}+\frac {x}{2}\right ) \sec \left (x \right )^{2} \sin \left (2 x \right )}{2} \] Which simplifies to \[ y_p(x) = -\frac {\cos \left (x \right )^{2}}{4}+\frac {x \tan \left (x \right )}{2}+\frac {1}{2} \] Therefore the general solution is \begin {align*} y &= y_h + y_p \\ &= \left (\sec \left (x \right )^{2} c_{1} +\frac {c_{2} \sec \left (x \right )^{2} \sin \left (2 x \right )}{2}\right ) + \left (-\frac {\cos \left (x \right )^{2}}{4}+\frac {x \tan \left (x \right )}{2}+\frac {1}{2}\right ) \end {align*}

Which simplifies to \[ y = \tan \left (x \right ) c_{2} +\sec \left (x \right )^{2} c_{1} -\frac {\cos \left (x \right )^{2}}{4}+\frac {x \tan \left (x \right )}{2}+\frac {1}{2} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \tan \left (x \right ) c_{2} +\sec \left (x \right )^{2} c_{1} -\frac {\cos \left (x \right )^{2}}{4}+\frac {x \tan \left (x \right )}{2}+\frac {1}{2} \\ \end{align*}

Verification of solutions

\[ y = \tan \left (x \right ) c_{2} +\sec \left (x \right )^{2} c_{1} -\frac {\cos \left (x \right )^{2}}{4}+\frac {x \tan \left (x \right )}{2}+\frac {1}{2} \] Verified OK.

Maple trace Kovacic algorithm successful

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 2; linear nonhomogeneous with symmetry [0,1] 
trying a double symmetry of the form [xi=0, eta=F(x)] 
trying symmetries linear in x and y(x) 
-> Try solving first the homogeneous part of the ODE 
   trying a symmetry of the form [xi=0, eta=F(x)] 
   checking if the LODE is missing y 
   -> Heun: Equivalence to the GHE or one of its 4 confluent cases under a power @ Moebius 
   -> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int(r(x), dx)) * 2F1([a1, a2], [b1], f) 
   -> Trying changes of variables to rationalize or make the ODE simpler 
      trying a quadrature 
      checking if the LODE has constant coefficients 
      checking if the LODE is of Euler type 
      trying a symmetry of the form [xi=0, eta=F(x)] 
      checking if the LODE is missing y 
      -> Trying a Liouvillian solution using Kovacics algorithm 
         A Liouvillian solution exists 
         Reducible group (found an exponential solution) 
         Reducible group (found another exponential solution) 
      <- Kovacics algorithm successful 
      Change of variables used: 
         [x = arcsin(t)] 
      Linear ODE actually solved: 
         2*u(t)+(6*t^5-7*t^3+t)*diff(u(t),t)+(2*t^6-5*t^4+4*t^2-1)*diff(diff(u(t),t),t) = 0 
   <- change of variables successful 
<- solving first the homogeneous part of the ODE successful`
 

Solution by Maple

Time used: 0.25 (sec). Leaf size: 29

dsolve([(tan(x)^2-1)*diff(y(x),x$2)-4*tan(x)^3*diff(y(x),x)+2*y(x)*sec(x)^4=(tan(x)^2-1)*(1-2*sin(x)^2),sec(x)^2],singsol=all)
 

\[ y \left (x \right ) = \frac {\left (4 c_{1} +2 x \right ) \tan \left (x \right )}{4}+\sec \left (x \right )^{2} c_{2} -\frac {\cos \left (x \right )^{2}}{4}+\frac {1}{2} \]

Solution by Mathematica

Time used: 0.764 (sec). Leaf size: 66

DSolve[(Tan[x]^2-1)*y''[x]-4*Tan[x]^3*y'[x]+2*y[x]*Sec[x]^4==(Tan[x]^2-1)*(1-2*Sin[x]^2),y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \sqrt {\sin ^2(x)} \sec (x) \arctan \left (\frac {\cos (x)}{1-\sqrt {\sin ^2(x)}}\right )-\frac {1}{4} \cos ^2(x)+c_1 \sec ^2(x)+c_2 \sqrt {\sin ^2(x)} \sec (x)+\frac {1}{2} \]