# How to solve this Cauchy problem $z' = (z + 4x) ^2$, $z(0) = 2$

First step is to expand the right side:

$\frac{dz}{dx} = z^2+8xz+16x^2$

This is a Riccati equation: see Riccati equation – Wikipedia

if we let $u = z+4x, \frac{du}{dx} = \frac{dz}{dx} + 4$, we can write this equation as $\frac{du}{dx} – 4 = u^2$

This equation is just separable, so we just have

$\frac{du}{u^2+4} = dx; \frac{1}{2}arctan(\frac{u}{2}) = x+C; \frac{1}{2}arctan\frac{z+4x}{2} = x+C$

Now we plug in the condition:

$1/2*arctan(2/2) = 0+C; π/8 = C$

$\frac{1}{2}arctan\frac{z+4x}{2} = x+\frac{π}{8}$

in implicit form.

## One Reply to “How to solve this Cauchy problem $z' = (z + 4x) ^2$, $z(0) = 2$”

1. Bruno Avritzer says:

$z' = \left(z + 4x\right)^2$

Set $y = z + 4x$, so $y' = z' + 4$, so $z' = y' – 4$.

$y' – 4 = y^2$

$y' = y^2 + 4$

$\frac{y'}{y^2+4} = 1$

$\int \frac{y'}{y^2+4} dx = \int 1 dx$

$\int \frac{\frac{dy}{dx}}{y^2+4} dx = x + C$

$\int \frac{1}{y^2+4} dy = x + C$

Setting $y = 2 \tan \left(\theta\right)$, which gives $dy = 2 \sec^2 \left(\theta\right) d\theta$:

$\int \frac{2\sec^2\left(\theta\right)}{4\tan^2\left(\theta\right)+4} d\theta = x + C$

$\int \frac{2\sec^2\left(\theta\right)}{4\sec^2\left(\theta\right)} d\theta = x + C$

$\int \frac{1}{2} d\theta = x + C$

$\frac{1}{2} \theta = x + C$

(The constant of integration gets swallowed up by the $+C$.)

$\frac{1}{2} \tan^{-1}\left(\frac{y}{2}\right) = x + C$

$\tan^{-1}\left(\frac{y}{2}\right) = 2x + C$

$\frac{y}{2} = \tan\left(2x+C\right)$

$y = 2\tan\left(2x+C\right)$

$z = y – 4x$

$z = 2\tan\left(2x+C\right) – 4x$

It is a good idea to substitute this into the original equation to check if it is correct.

$z' = 4\sec^2\left(2x+C\right) – 4$

$= 4\tan^2\left(2x+C\right)$

$\left(z + 4x\right)^2 = \left(2\tan\left(2x+C\right)\right)^2$

$= 4\tan^2\left(2x+C\right)$

so this is the correct solution set.

What remains is to find $C$. $z\left(0\right) = 2$, so:

$2 = 2\tan\left(2\left(0\right)+C\right) – 4\left(0\right)$

$2 = 2\tan\left(C\right)$

$\tan\left(C\right) = 1$

$C = \frac{\pi}{4} + n\pi$, where $n$ is an integer

$z = 2\tan\left(2x+\frac{\pi}{4} + n\pi\right) – 4x$

The choice of $n$ does not matter, because the tangent function is periodic with period $\pi$.

$z = 2\tan\left(2x+\frac{\pi}{4}\right) – 4x$

This is the solution. For completeness, one might note that this has vertical asymptotes at $x = \frac{\pi}{8} + \frac{n\pi}{2}$ (where $n$ is an integer), so the domain of this solution is restricted to the open interval $\left(-\frac{3\pi}{8}, \frac{\pi}{8}\right)$. What happens outside this interval (assuming we are looking for real solutions only)? $z = 2\tan\left(2x+C\right) – 4x$ is still true, but each interval between two vertical asymptotes is allowed to have its own $C$, as what happens at $x = 0$ cannot influence things beyond a break in the domain of applicability. (Change $C$ in any interval between asymptotes, and the differential equation still holds at every point in the domain of $y$.) If one wants to go around such breaks, a good way to do so is to ask for complex solutions rather than real ones.