How did my textbook remove the absolute value from this linear differential equation problem?

43 Views Asked by At

The question is to solve the inital-value problem $xy'=y+x^2\sin{x}, y\left(\pi\right)=0$. I got to the same answer as the textbook except I have an x in absolute value. Here's what I did: $$y'-\frac{y}{x}=x\sin{x}$$ $$y'e^{-\int{\frac{1}{x}dx}}-\frac{y}{x}e^{-\int{\frac{1}{x}dx}}=x\sin{\left(x\right)}e^{-\int{\frac{1}{x}dx}}$$ $$\frac{y'}{|x|}-\frac{y}{x|x|}=\frac{x\sin{x}}{|x|}$$ $$\frac{y}{|x|}=\int{\frac{x\sin{x}}{|x|}dx}$$ $$\frac{y}{|x|}=-\frac{x\cos{x}}{|x|}+\int{\left[\frac{x}{|x|}\right]'\cos{x}dx}+C=-\frac{x\cos{x}}{|x|}+C$$ $$y=-x\cos{x}+C|x|$$ $$y\left(\pi\right)=0=-\pi\cos{\pi}+C\pi\implies{C=-1}$$ $$y=-x\cos{x}-|x|$$ However, the textbook's answer is $y=-x\cos{x}-x$. Where did I go wrong / how did they remove it?

1

There are 1 best solutions below

0
On

The domain of your ODE does not contain the line $x=0$. The differential equation is either singular there, or simply not defined. As such, the integrating factor $e^c|x|^{-1}$ can be chosen to be $x^{-1}$ in both parts of the domain.

The difference to any other possible integrating factor is a constant factor. It may be a different constant for each connected part of the domain.