The integration you performed is not correct as $x$ has dependence on $y$ (in fact, the first equation tell us how they are related).
Nevertheless, we can integrate the equations. Further, we get an explicit expression for $u$. I take as starting point these equations:
$$\frac{dx}{\cos(ky)}=\frac{dy}{1}=\frac{du}{ax^2}$$
From them:
$dx=dy\cos(ky)$ and $\dfrac{ax^2dx}{\cos(ky)}=du$ From the first one,
$x+c_1=\dfrac{1}{k}\sin(ky)$ or $c_1=\dfrac{1}{k}\sin(ky)-x$
From here, we can write the cosine as function of $x$ to integrate the second one:
$\sqrt{1-k^2(x+c_1)^2}=\cos(ky)$
Substituting into the second one
$\dfrac{ax^2dx}{\sqrt{1-k^2(x+c_1)^2}}=du$
And integrating:
$$u+c_2=\dfrac{a\left((2k^2c_1^2+1)\arcsin(k(x+c_1))+k(3c_1-x)\sqrt{1-k^2(x+c_1)^2}\right)}{2k^3}$$
Eliminating $c_1$
$$u+c_2=\dfrac{a\left(\left(2k^2\left(\dfrac{1}{k}\sin(ky)-x\right)^2+1\right)y+\left(\dfrac{3}{k}\sin(ky)-4x\right)\cos(ky)\right)}{2k^2}$$
At last, considering that $c_2=f(c_1)$ with $f$ a single argument differentiable function, the general solution is:
$$u(x,y)=\dfrac{a\left(\left(2k^2\left(\dfrac{1}{k}\sin(ky)-x\right)^2+1\right)y+\left(\dfrac{3}{k}\sin(ky)-4x\right)\cos(ky)\right)}{2k^2}-f\left(\dfrac{1}{k}\sin(ky)-x\right)$$
Now, the boundary conditions $u(x,0)=0$ impose some restriction for $f$:
$$u(x,0)=\dfrac{-2ax}{k^2}-f(-x)=0$$
So $f(x)=\dfrac{2ax}{k^2}$ and
$$u(x,y)=\dfrac{a\left(\left(2k^2\left(\dfrac{1}{k}\sin(ky)-x\right)^2+1\right)y+\left(\dfrac{3}{k}\sin(ky)-4x\right)\cos(ky)\right)}{2k^2}-\dfrac{2a}{k^2}\left(\dfrac{1}{k}\sin(ky)-x\right)$$
$$u(x,y)=\dfrac{a}{2k^2}\left(\left(2k^2\left(\dfrac{1}{k}\sin(ky)-x\right)^2+1\right)y+\left(\dfrac{3}{k}\sin(ky)-4x\right)\cos(ky)-\left(\dfrac{1}{k}\sin(ky)-x\right)4\right)$$
First, we can drop $x_0$ as it doesn't entail the graph of the curves to change, then apply the initial conditions.
$$\quad x(t) = t; \quad y(t) = \frac{1}{2}t^2+y_0; \quad u(t)=t+u_0$$
$$y= \frac{1}{2}x^2+y_0; \quad u=x+u_0$$
Now $u(3,y)=y^2$, so is $3+u_0=\left(\frac{1}{2}3^2+y_0\right)^2$, bringing us the desired relation between $y_0$ and $u_0$... to get rid of them!
$y_0=y-\frac{1}{2}x^2; \quad u_0=\left(\frac{1}{2}3^2+y_0\right)^2-3$
$u=x+\left(\frac{1}{2}3^2-\frac{1}{2}x^2+y\right)^2-3$
Best Answer
Note that while $U(x,0) = U_0(x)$, the PDE itself isn't satisfied. \begin{align} U_t + (1 + \cos t)U_x &= -1 + U_0'(x - t + \sin t)(-1 + \cos t) + U_0'(x - t + \sin t)(1 + \cos t) \\ &= -1 + 2\cos t \ U_0'(x - t + \sin t) \\ &\not \equiv -2. \end{align}
But $$ \frac{\mathrm{d}U}{\mathrm{d}t} = -2 \implies U(x(t),t) = -2t + c_1 $$ and $$ x(t) = t + \sin t + x_0 \implies x_0 = x(t) - t - \sin t. $$