2.94   ODE No. 94

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

\[ a y(x)+b x^n+x y'(x)=0 \] Mathematica : cpu = 0.0165009 (sec), leaf count = 25

\[\left \{\left \{y(x)\to c_1 x^{-a}-\frac {b x^n}{a+n}\right \}\right \}\]

Maple : cpu = 0.01 (sec), leaf count = 23

\[ \left \{ y \left ( x \right ) =-{\frac {b{x}^{n}}{n+a}}+{x}^{-a}{\it \_C1} \right \} \]

Hand solution

\[ xy^{\prime }+ay+bx^{n}=0 \]

Linear first order, exact, separable. \(y^{\prime }+\frac {ay}{x}=-bx^{n-1}\), integrating factor \(\mu =e^{\int \frac {a}{x}dx}=e^{a\ln x}=x^{a}\), hence\begin {align*} d\left ( \mu y\right ) & =-\mu bx^{n-1}\\ x^{a}y & =-\int bx^{a+n-1}+C \end {align*}

If \(a=-n\) then

\begin {align*} x^{a}y & =-\int bx^{-1}+C\\ y & =-x^{-a}b\ln \left ( x\right ) +x^{-a}C\\ & =x^{-a}\left ( C-b\ln x\right ) \end {align*}

If \(a\neq -n\) then

\begin {align*} x^{a}y & =-\frac {bx^{a+n}}{a+n}+C\\ y & =-b\frac {x^{n}}{a+n}+Cx^{-a} \end {align*}

Verification

restart; 
ode:=x*diff(y(x),x)+a*y(x)+b*x^n=0; 
s1:=x^(-a)*(_C1-b*ln(x)); 
s2:=-b*(x^n/(a+n))+_C1*x^(-a); 
odetest(y(x)=s2,ode); 
0