50.14.15 problem 2(g)

Internal problem ID [8053]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 2. Problems for Review and Discovery. Drill excercises. Page 105
Problem number : 2(g)
Date solved : Wednesday, March 05, 2025 at 05:26:33 AM
CAS classification : [[_2nd_order, _quadrature]]

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

With initial conditions

\begin{align*} y \left (1\right )&=1\\ y^{\prime }\left (1\right )&=-1 \end{align*}

Maple. Time used: 1.082 (sec). Leaf size: 130
ode:=diff(diff(y(x),x),x) = tan(x); 
ic:=y(1) = 1, D(y)(1) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (-i {\mathrm e}^{2 i}-i\right ) \operatorname {polylog}\left (2, -{\mathrm e}^{2 i x}\right )+2 x \left ({\mathrm e}^{2 i}+1\right ) \ln \left ({\mathrm e}^{2 i x}+1\right )+\left (i {\mathrm e}^{2 i}+i\right ) \operatorname {polylog}\left (2, -{\mathrm e}^{2 i}\right )+\left (-2 \,{\mathrm e}^{2 i}-2\right ) \ln \left ({\mathrm e}^{2 i}+1\right )+\left (2 \ln \left (\cos \left (1\right )\right ) x -2 x \ln \left (\cos \left (x \right )\right )+\left (-2 x +2\right ) \tan \left (1\right )-i x^{2}+\left (-2-2 i\right ) x +4+3 i\right ) {\mathrm e}^{2 i}+2 \ln \left (\cos \left (1\right )\right ) x -2 x \ln \left (\cos \left (x \right )\right )+\left (-2 x +2\right ) \tan \left (1\right )-i x^{2}+\left (-2+2 i\right ) x +4-i}{2 \,{\mathrm e}^{2 i}+2} \]
Mathematica. Time used: 0.032 (sec). Leaf size: 86
ode=D[y[x],{x,2}]==Tan[x]; 
ic={y[1]==1,Derivative[1][y][1]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \left (-i \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+i \operatorname {PolyLog}\left (2,-e^{2 i}\right )-i x^2-2 x+2 x \log \left (1+e^{2 i x}\right )-2 x \log (\cos (x))+2 x \log (\cos (1))+(4+i)-2 \log \left (1+e^{2 i}\right )\right ) \]
Sympy. Time used: 0.921 (sec). Leaf size: 70
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-tan(x) + Derivative(y(x), (x, 2)),0) 
ics = {y(1): 1, Subs(Derivative(y(x), x), x, 1): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (- \log {\left (\cos {\left (x \right )} \right )} + \frac {- \sin {\left (1 \right )} - \cos {\left (1 \right )} + \log {\left (\cos {\left (1 \right )} \right )} \cos {\left (1 \right )} + \cos {\left (1 \right )} \tan {\left (1 \right )}}{\cos {\left (1 \right )}}\right ) + \frac {\cos {\left (1 \right )} \int \limits ^{1} x \tan {\left (x \right )}\, dx - \cos {\left (1 \right )} \tan {\left (1 \right )} + \sin {\left (1 \right )} + 2 \cos {\left (1 \right )}}{\cos {\left (1 \right )}} - \int x \tan {\left (x \right )}\, dx \]