76.3.4 problem 4

Internal problem ID [17304]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.4 (Differences between linear and nonlinear equations). Problems at page 79
Problem number : 4
Date solved : Monday, March 31, 2025 at 03:50:12 PM
CAS classification : [_linear]

\begin{align*} \left (-t^{2}+4\right ) y^{\prime }+2 t y&=3 t^{2} \end{align*}

With initial conditions

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

Maple. Time used: 0.058 (sec). Leaf size: 55
ode:=(-t^2+4)*diff(y(t),t)+2*t*y(t) = 3*t^2; 
ic:=y(-3) = 1; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \frac {3 t}{2}-\frac {3 \ln \left (t -2\right ) t^{2}}{8}+\frac {3 \ln \left (t -2\right )}{2}+\frac {3 \ln \left (t +2\right ) t^{2}}{8}-\frac {3 \ln \left (t +2\right )}{2}+\frac {11 t^{2}}{10}-\frac {22}{5}+\frac {3 \ln \left (5\right ) t^{2}}{8}-\frac {3 \ln \left (5\right )}{2} \]
Mathematica. Time used: 0.068 (sec). Leaf size: 39
ode=(4-t^2)*D[y[t],t]+2*t*y[t]==3*t^2; 
ic={y[-3]==1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {1}{5} \left (t^2-4\right ) \left (5 \int _{-3}^t-\frac {3 K[1]^2}{\left (K[1]^2-4\right )^2}dK[1]+1\right ) \]
Sympy. Time used: 0.415 (sec). Leaf size: 71
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-3*t**2 + 2*t*y(t) + (4 - t**2)*Derivative(y(t), t),0) 
ics = {y(-3): 1} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = - \frac {3 t^{2} \log {\left (t - 2 \right )}}{8} + \frac {3 t^{2} \log {\left (t + 2 \right )}}{8} + t^{2} \left (\frac {3 \log {\left (5 \right )}}{8} + \frac {11}{10}\right ) + \frac {3 t}{2} + \frac {3 \log {\left (t - 2 \right )}}{2} - \frac {3 \log {\left (t + 2 \right )}}{2} - \frac {22}{5} - \frac {3 \log {\left (5 \right )}}{2} \]