Find all real-valued \(C^1\) solutions \(y\) on \((-1,1)\) of \[ x\frac{dy}{dx}+y=x. \]
Solution
1. Every \(C^1\) solution satisfies\[ (xy)'=x \]on \((-1,1)\).
By the product rule, \[ (xy)'=xy'+y. \] The differential equation therefore gives \((xy)'=x\) at every point of the interval, including \(x=0\).
2. There is a constant \(C\in\RR\) such that\[ xy(x)=\frac{x^2}{2}+C \]for every \(x\in(-1,1)\).
By step 1, \[ \left(xy(x)-\frac{x^2}{2}\right)'=0 \] on the connected interval \((-1,1)\). Hence the expression in parentheses is constant.
3. The constant in step 2 is \(C=0\).
Substituting \(x=0\) into the identity from step 2 gives \[ 0=C. \]
4. Every solution is\[ \boxed{y(x)=\frac{x}{2}} \]on \((-1,1)\).
For \(x\neq0\), steps 2 and 3 give \[ xy(x)=\frac{x^2}{2}, \] so \(y(x)=x/2\). Since \(y\) is continuous, \[ y(0) = \lim_{x\to0}y(x) = 0, \] which is also the value of \(x/2\) at \(0\).
5. The function \(y(x)=x/2\) is indeed a \(C^1\) solution.
It is \(C^1\) on \((-1,1)\), and \[ x\left(\frac12\right)+\frac{x}{2}=x. \]
6. Q.E.D.
Steps 4 and 5 show that the displayed function is the unique \(C^1\) solution.