83.11.11 problem 11

Internal problem ID [22000]
Book : Differential Equations By Kaj L. Nielsen. Second edition 1966. Barnes and nobel. 66-28306
Section : Chapter VI. Linear equations with constant coefficients. Ex. XIII at page 106
Problem number : 11
Date solved : Thursday, October 02, 2025 at 08:21:33 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 4 y+y^{\prime \prime }&=2 \tan \left (x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 40
ode:=diff(diff(y(x),x),x)+4*y(x) = 2*tan(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2 \ln \left (\cos \left (x \right )\right ) \sin \left (x \right ) \cos \left (x \right )+\left (2 c_1 -2 x \right ) \cos \left (x \right )^{2}+\sin \left (x \right ) \left (2 c_2 +1\right ) \cos \left (x \right )+x -c_1 \]
Mathematica. Time used: 0.031 (sec). Leaf size: 33
ode=D[y[x],{x,2}]+4*y[x]==2*Tan[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to (-x+c_1) \cos (2 x)+\sin (x) \cos (x) (2 \log (\cos (x))-1+2 c_2) \end{align*}
Sympy. Time used: 0.518 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - 2*tan(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - x\right ) \cos {\left (2 x \right )} + \left (C_{2} + \log {\left (\cos {\left (x \right )} \right )}\right ) \sin {\left (2 x \right )} \]