# Thread: What am I doing wrong, differential equation

1. ## What am I doing wrong, differential equation

We're looking for $\displaystyle x(t)$. The data are : $\displaystyle x'=f(t,x)$, $\displaystyle x(0)=0$.
We have $\displaystyle f(t,x)=1+x^2$.
I rewrite it as $\displaystyle \frac{dx}{dt}=1+x^2$. Which is equivalent to $\displaystyle 1=\frac{dx}{(1+x^2)dt}$. Equivalent to $\displaystyle \int dt=\int \frac{dx}{1+x^2}$. Which means that $\displaystyle t=arctan(x)$. As we were looking for $\displaystyle x(t)$, from what we got it's easy to see that $\displaystyle x(t)=tan(t)$. $\displaystyle x(0)=0$ is satisfied.
Now looking at the beginning, we had that $\displaystyle x'(t)=1+x^2$. What I'm missing to understand is how my solution works here? If I derivate $\displaystyle tan(t)$ I won't get the $\displaystyle 1+x^2$. I'm confused.

2. Originally Posted by arbolis
We're looking for $\displaystyle x(t)$. The data are : $\displaystyle x'=f(t,x)$, $\displaystyle x(0)=0$.
We have $\displaystyle f(t,x)=1+x^2$.
I rewrite it as $\displaystyle \frac{dx}{dt}=1+x^2$. Which is equivalent to $\displaystyle 1=\frac{dx}{(1+x^2)dt}$. Equivalent to $\displaystyle \int dt=\int \frac{dx}{1+x^2}$. Which means that $\displaystyle t=arctan(x)$. As we were looking for $\displaystyle x(t)$, from what we got it's easy to see that $\displaystyle x(t)=tan(t)$. $\displaystyle x(0)=0$ is satisfied.
Now looking at the beginning, we had that $\displaystyle x'(t)=1+x^2$. What I'm missing to understand is how my solution works here? If I derivate $\displaystyle tan(t)$ I won't get the $\displaystyle 1+x^2$. I'm confused.
$\displaystyle t = \arctan(x) + C$. Impose the boundary condition: C = 0.

So $\displaystyle t = \arctan(x) \Rightarrow x = \tan (t)$. So all is well.

$\displaystyle \frac{dx}{dt} = \sec^2 t = 1 + \tan^2 t = 1 + x^2$. So there's no problem - things work just fine.

3. . So there's no problem - things work just fine.
That may looks innocent but now I understand what I wasn't understanding! Great.