Cauchy problem, $x' -\frac{x}{t}=t, x(1)=0$ I cannot solve this Cauchy problem: $x'-\frac{x}{t}=t, x(1)=0$
$p(t)=-\frac{1}{t} \Rightarrow u(t)=e^{-\int\frac{1}{t}dt}=e^{-ln|t|}$
$x' \cdot e^{-ln|t|}-\frac{x}{t} e^{-ln|t|}=t\cdot e^{-ln|t|}$
$(xe^{-ln|t|})'=t\cdot e^{-ln|t|}$
$xe^{-ln|t|}=t+C$
$x(t)=1+\frac{C}{t}$
So, In short, I was doing this problem by multiplying each side with e taken to the power of integral of $\frac{1}{t}$ and I get the result as $x(t)=1+\frac{C}{t}.$ The answer is completely off, I should get $x=t^2-t, t>0.$
 A: You have figured out that the integrating factor is $t$
So define $y$ by $x \equiv ty$
write the DE in terms of $y$
$$ (ty)' - \frac {ty}t = ty' +y-y=t   $$
So $y'=1 \implies y=t+C \implies x=t^2+Ct$
use initial condition to get $C=-1$
A: The integrating factor is given by $\displaystyle\exp\left(-\ln(t)\right) = \frac{1}{t}$. Consequently, one has
\begin{align*}
x^{\prime} - \frac{x}{t} = t \Longleftrightarrow \frac{x^{\prime}}{t} - \frac{x}{t^{2}} = 1 \Longleftrightarrow \left(\frac{x}{t}\right)^{\prime} = 1 \Longleftrightarrow \frac{x}{t} = t + k \Longleftrightarrow x(t) = t^{2} + kt
\end{align*}
Since $x(1) = 0$, we conclude that $k = -1$. Thus the final solution is $x(t) = t^{2} - t$ for $t > 0$.
A: I would follow the procedure I learned in my ODE course and textbook.
1) Write out the general form of the first order linear ODE
$$\frac{dx}{dt}+P(t)x=Q(t)$$
You are given 
$$\frac{dx}{dt}-\frac{x}{t}=t \implies P(t)=-\frac1t,~Q(t)=t$$
2) Find the integrating factor
$$\mu(t)=\text{exp}{\int P(t)dt}=\text{exp}\int-\frac1t dt=\text{exp}\big({-\ln|t|}\big)=\frac{1}{t}$$
3) Multiply your original equation by the integrating factor
$$\frac1t\frac{dx}{dt}-\frac{x}{t^2}=1 $$
4) Reduce to $\frac{d}{dt}$ on the LHS
$$\frac{d}{dt}(\frac1t x)=1$$
5) Integrate both sides with respect to $t$
$$\frac x t=t+C \implies x=t^2+Ct$$
6) Evaluate the initial condition of $x(1)=0$
$$x(1)=0\implies 0=1+c \implies C=-1$$
7) Solve for $x(t)$
$$x(t)=t^2-t$$
where $t>0$ follows directly from step 2. The integrating factor of $\frac{1}{t}$ is only defined for $t>0$.
