74.1.54 problem 75

Internal problem ID [15763]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 1. Introduction to Differential Equations. Exercises 1.1, page 10
Problem number : 75
Date solved : Monday, March 31, 2025 at 01:47:31 PM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=x*diff(y(x),x)+y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\sin \left (x \right )+c_1}{x} \]
Mathematica. Time used: 0.03 (sec). Leaf size: 22
ode=x*D[y[x],x]+y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\int _1^x\cos (K[1])dK[1]+c_1}{x} \]
Sympy. Time used: 0.264 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + y(x) - cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \sin {\left (x \right )}}{x} \]