76.2.26 problem 26

Internal problem ID [17291]
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.2 (Linear equations: Method of integrating factors). Problems at page 54
Problem number : 26
Date solved : Monday, March 31, 2025 at 03:49:02 PM
CAS classification : [_linear]

\begin{align*} \sin \left (t \right ) y^{\prime }+\cos \left (t \right ) y&={\mathrm e}^{t} \end{align*}

With initial conditions

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

Maple. Time used: 0.046 (sec). Leaf size: 18
ode:=sin(t)*diff(y(t),t)+cos(t)*y(t) = exp(t); 
ic:=y(1) = a; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \left ({\mathrm e}^{t}+a \sin \left (1\right )-{\mathrm e}\right ) \csc \left (t \right ) \]
Mathematica. Time used: 0.057 (sec). Leaf size: 19
ode=Sin[t]*D[y[t],t]+Cos[t]*y[t]==Exp[t]; 
ic={y[1]==a}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \csc (t) \left (a \sin (1)+e^t-e\right ) \]
Sympy. Time used: 0.339 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(y(t)*cos(t) - exp(t) + sin(t)*Derivative(y(t), t),0) 
ics = {y(1): a} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \frac {a \sin {\left (1 \right )} + e^{t} - e}{\sin {\left (t \right )}} \]