Given that $x =2$ at $t = 1$, how would I solve this differential equation?
$$\frac{dx}{dt}=2-\frac2{x^2} \tag 1$$
Usually I would separate the variables, but due to the subtraction I don't think I can do it this way.
Given that $x =2$ at $t = 1$, how would I solve this differential equation?
$$\frac{dx}{dt}=2-\frac2{x^2} \tag 1$$
Usually I would separate the variables, but due to the subtraction I don't think I can do it this way.
On
Method of fractions and fractions decomposition works fine: $$\frac{dx}{dt}=2-\frac2{x^2}$$ $$\frac{dx}{dt}=\frac {2x^2-2}{x^2}$$ $$\frac{dx}{2x^2-2}=\frac {dt}{x^2}$$ Substract fractions: $$-\frac{dx-2dt}{2}=\frac {dx}{2x^2-2}$$ $$d(2t-x)=\frac {dx}{x^2-1}$$ $$2d(2t-x)= \left ( \frac 1 {x-1} -\frac 1 {x+1}\right ) {dx} $$ Integrate $$2(2t-x)+C= \ln \left | \frac {x-1} {x+1}\right | $$ Initial condition gives $$x(1)=2 \implies C=-\ln 3$$ $$4t-2x-\ln 3= \ln \left | \frac {x-1} {x+1}\right | $$ $$4t=2x+ \ln \left | \frac {3(x-1)} {x+1}\right | $$
The given ordinary differential equation
$$\frac{dx}{dt}=2-\frac2{x^2}$$
can be rewritten as
$$\frac{1}{2-\frac2{x^2}}dx=dt$$
which is separable. To integrate the left-hand side, one can first apply long division to form
$$\frac{1}{2-\frac2{x^2}}=-\frac{1}{4(x+1)}+\frac{1}{4(x-1)}+\frac{1}{2}$$