28.2.63 problem 63

Internal problem ID [4506]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 4. Linear Differential Equations. Page 183
Problem number : 63
Date solved : Monday, January 27, 2025 at 09:22:01 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y&=2 \tan \left (x \right ) \end{align*}

Solution by Maple

Time used: 0.003 (sec). Leaf size: 40

dsolve(diff(y(x),x$2)+4*y(x)=2*tan(x),y(x), singsol=all)
 
\[ y \left (x \right ) = 2 \cos \left (x \right ) \sin \left (x \right ) \ln \left (\cos \left (x \right )\right )+\left (-2 x +2 c_{1} \right ) \cos \left (x \right )^{2}+\left (2 c_{2} +1\right ) \sin \left (x \right ) \cos \left (x \right )+x -c_{1} \]

Solution by Mathematica

Time used: 0.047 (sec). Leaf size: 33

DSolve[D[y[x],{x,2}]+4*y[x]==2*Tan[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to (-x+c_1) \cos (2 x)+\sin (x) \cos (x) (2 \log (\cos (x))-1+2 c_2) \]