63.4.16 problem 6

Internal problem ID [12980]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.3.1 Separable equations. Exercises page 26
Problem number : 6
Date solved : Wednesday, March 05, 2025 at 08:55:48 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

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

With initial conditions

\begin{align*} x \left (0\right )&=1 \end{align*}

Maple. Time used: 0.210 (sec). Leaf size: 28
ode:=diff(x(t),t) = (4*t-x(t))^2; 
ic:=x(0) = 1; 
dsolve([ode,ic],x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {\left (4 t -2\right ) {\mathrm e}^{4 t}+12 t +6}{3+{\mathrm e}^{4 t}} \]
Mathematica. Time used: 0.155 (sec). Leaf size: 31
ode=D[x[t],t]==(4*t-x[t])^2; 
ic={x[0]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {12 t+e^{4 t} (4 t-2)+6}{e^{4 t}+3} \]
Sympy. Time used: 0.316 (sec). Leaf size: 31
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-(4*t - x(t))**2 + Derivative(x(t), t),0) 
ics = {x(0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {2 \left (- 2 t e^{4 t} - 6 t + e^{4 t} - 3\right )}{- e^{4 t} - 3} \]