Determine the general solution of the ODE
y'(x) = \dfrac{C}{Cx + D}(y(x) + A)^2
and the constant \color{red}C
for the initial value y(0) = 0
.
y(x)
=
-\frac{1}{\ln |Cx +D| + C} - A
\color{red}C
=
-\lnabs(D) - 1/A
We look for the general solution using the separation of variables.
We rewrite the ODE as: y'(x) = \dfrac{dy}{dx}
= \dfrac{C}{Cx + D}(y(x) + A)^2
\implies \dfrac{1}{(y(x) + A)^2} \ dy
= \dfrac{C}{Cx +D} \ dx.
Now we look for antiderivatives \displaystyle
\int \dfrac{1}{(y(x) + A)^2} \ dy = - \dfrac{1}{(y(x) + A)}
= \int\dfrac{C}{Cx +D} \ dx
= \ln|Cx +D| + C.
For the right-hand side we use \displaystyle \int\dfrac{f'(x)}{f(x)} \ dx = \ln| f(x)| + C
.
It remains to solve \displaystyle = - \dfrac{1}{(y(x) + A)}
= \ln |Cx +D| + C
, i.e. to isolate y(x)
:
With the reciprocal and subtraction we find \displaystyle
y(x) = -\dfrac{1}{\ln |Cx +D| + C} - A
.
For the constant C
we set x=0
and use the inital value y(0) = 0
:
\displaystyle
y(0) = 0 = - \dfrac{1}{\ln |D| +C} - A = - \dfrac{1}{\ln (abs(D)) +C} - A
\implies {\color{red} C = - \ln(abs(D)) - fractionReduce(1,A)}
.