Initial value problem $t\frac{dx}{dt}=x+\sqrt{t^2+x^2}$ Another question on ODEs, this time just wondering how I should start with this one.
$$t\frac{dx}{dt}=x+\sqrt{t^2+x^2}, \qquad x(1)=0.$$ It looks like a linear ODE and so after playing around with it I eventually got $$\frac{dx}{dt}-\frac{2}{t}x=\frac{dt}{dx}$$ to which I multiplied the integrating factor $$I(t)=t^{-2}=\frac{1}{t^2}.$$ This in turn gave me $$\frac{x}{t^2}=\int{\frac{1}{t^2}t'dt},$$ and then I used integration by parts to get $$\frac{x}{t^2}=\frac{-1}{t}+C.$$ Applying the initial conditions gave me $$x=t(t-1).$$ The answer in the book is however $$x=\frac{1}{2}(t^2-1).$$
Where did I go wrong? What should I do to solve this problem? Thanks.
 A: Hint to guide you through (fill in the details):
Let $x = tv$
We have $x' = v + t v'$, so:
$t\dfrac{dx}{dt}= t(t v' + v) = tv + \sqrt{t^2+t^2 v^2}$
Simplifying, we get:
$v' = \dfrac{\sqrt {v^2+1}}{t} \rightarrow \dfrac{v'}{\sqrt {v^2+1}} = \dfrac{1}{t}$
Upon integrating, we have $v(t) = \sinh (\ln t + c)$, so:
$x(t) = t v = t \sinh (\ln t + c)$.
If we use the initial condition, you get $c = 0$.
Can you finish it off? (You know the expansion for $\sinh x$, use it and you end up with the book answer.
Update
Here are the details for:
$$\tag 1 \int \dfrac{dv}{\sqrt {v^2+1}}$$
Let $v = \tan u \rightarrow dv = \sec^2 u ~du$
Note, from the above substitution, we have $u = \tan^{-1} v$ (we need this later).
So, $\sqrt{1 + v^2} = \sqrt{1 + \tan^2 u} = \sec u$
Substituting and simplifying into $(1)$, yields:
$$\tag 2 \int \dfrac{dv}{\sqrt {v^2+1}} = \int \sec u ~du$$
Lets multiply the numerator and denominator of $(2)$ by $(\sec u + \tan u)$, so we have:
$$\tag 3 \int \sec u ~du = \int \sec u \dfrac{\sec u + \tan u}{\sec u + \tan u} ~du = \int \dfrac{\sec^2 u + \sec u \tan u}{\sec u + \tan u} ~du$$
Let $w =  (\sec u + \tan u) \rightarrow dw = (\sec^2 u + \sec u \tan u)~ dw$, so $(3)$ reduces to:
$$\tag 4 \int \dfrac{1}{w}~dw = \ln w + c$$
Substituting $w$ back into $(4)$, yields:
$$\tag 5 \ln(\sec u + \tan u) + c$$
But, recall from the work above, we have, $u = \tan^{-1} v$, so substituting into $(5)$, yields:
$$\tag 6 \ln(\sec(\tan^{-1} v) + \tan(\tan^{-1} v) + c$$
However, from the substitutions we made within $(1)$, we have $\sec(\tan^{-1} v) = \sqrt{1 + v^2}$, so $(6)$ reduces to:
$$\ln(\sqrt{1 + v^2} + v) + c$$
Update 2
Now, we have:
$$\ln(\sqrt{1 + v^2} + v) + c = \ln t + c$$
We can make a substitution for the LHS using $\sinh$ or work with it in its current form.
Taking exponential, solving for $v(t)$, substituting in $x(t) = v t$ and using the IC, we arrive at:
$$x(t) = \dfrac{1}{2}(t^2-1)$$
