Solution (source code)

= Solution

Write $r=x-\bar x$, $A(t)=\int_0^t\alpha(s)ds$, and use the usual reduced rigid-recoil representation $h=Z+r\theta-\alpha r^2$, with zero initial recoil and a smooth stroke returning $\alpha$ and $\dot\alpha$ to zero. For this representation,
$$
\gamma=Z+U\int_0^t\theta(s)ds,\qquad
w=\dot\gamma+r\dot\theta-\dot\alpha r^2-2U\alpha r.
$$
Define the fluid impulse and its first moment by
$$
Q=M_0\dot\gamma+M_1\dot\theta-M_2\dot\alpha-2UM_1\alpha,\qquad
P=M_1\dot\gamma+M_2\dot\theta-M_3\dot\alpha-2UM_2\alpha.
$$
The <force> law from part (i) gives, by <integration by parts>,
$$
\int_0^L F_zdx=\dot Q+U[mw]_0^L,\qquad
\int_0^L rF_zdx=\dot P+U[rmw]_0^L-UQ.
$$
These are the <endpoint momentum flux in elongated-body recoil>. Put
$$
B_j=[m(x)r^j]_0^L,\qquad j=0,1,2,3.
$$
The endpoint quantities are needed in addition to the integrals $M_j$ unless further end-shape assumptions are made. Lateral <force> and yaw <torque> balance are
$$
M_b\ddot Z=-\dot Q-U[mw]_0^L,\qquad
I_b\ddot\theta=-\dot P-U[rmw]_0^L+UQ.
$$
Expanding gives the requested simultaneous second-order equations, with the retained endpoint fluxes:
$$
\boxed{\begin{aligned}
(M_b+M_0)\ddot Z+M_1\ddot\theta+UB_0\dot Z
+U(M_0+B_1)\dot\theta+U^2B_0\theta
&=M_2\ddot\alpha+U(2M_1+B_2)\dot\alpha+2U^2B_1\alpha,\\
M_1\ddot Z+(I_b+M_2)\ddot\theta+U(B_1-M_0)\dot Z
+UB_2\dot\theta+U^2(B_1-M_0)\theta
&=M_3\ddot\alpha+U(M_2+B_3)\dot\alpha+2U^2(B_2-M_1)\alpha.
\end{aligned}}
$$
Substituting $\ddot Z=\ddot\gamma-U\dot\theta$ and integrating once from the initially straight, unrecoiling state yields
$$
\boxed{\begin{aligned}
(M_b+M_0)\dot\gamma+M_1\dot\theta+UB_0\gamma+U(B_1-M_b)\theta
&=M_2\dot\alpha+U(2M_1+B_2)\alpha+2U^2B_1A,\\
M_1\dot\gamma+(I_b+M_2)\dot\theta+U(B_1-M_0)\gamma+U(B_2-M_1)\theta
&=M_3\dot\alpha+U(M_2+B_3)\alpha+2U^2(B_2-M_1)A.
\end{aligned}}
$$
These are first-order coupled equations for $\gamma,\theta$ with known forcing.

The claimed mass-independent final angle requires a qualification. Let
$$
\mathsf M=\begin{pmatrix}M_b+M_0&M_1\\M_1&I_b+M_2\end{pmatrix},\qquad
\mathsf K=\begin{pmatrix}B_0&B_1-M_b\\B_1-M_0&B_2-M_1\end{pmatrix}.
$$
After the stroke, $\alpha=\dot\alpha=0$ and $A=A_T=\int_0^T\alpha dt$. If the post-stroke dynamics are stable, the first-order system relaxes to
$$
\mathsf K\begin{pmatrix}\gamma_\infty\\\theta_\infty\end{pmatrix}
=2UA_T\begin{pmatrix}B_1\\B_2-M_1\end{pmatrix}.
$$
Let $C=B_0(B_2-M_1)-B_1(B_1-M_0)$. Solving this two-by-two system gives
$$
\boxed{\theta_\infty=2UA_T\frac{C}{C+M_b(B_1-M_0)},\qquad
\gamma_\infty=2UA_T\frac{M_b(B_2-M_1)}{C+M_b(B_1-M_0)}.}
$$
This is <quadratic-bend turning with finite body mass>. At the limiting state $\dot\theta=\dot\gamma=0$, so $\dot Z=-U\theta_\infty$. The forward <velocity> is $-U$ in the chosen $x$ direction, and its lateral component has precisely the body's slope: the fish glides parallel to itself. The angle is generally reached after a relaxation transient, not necessarily immediately at $t=T$.

The advertised result is obtained in the thin-body approximation that neglects $M_b$ relative to fluid <added mass>, or in the special geometry $B_1=M_0$:
$$
\boxed{\theta_\infty=2U\int_0^T\alpha(t)dt.}
$$
For example, take negligible nose <added mass> and nonzero tail <added mass> $m_T$, so $B_j=m_T(L-\bar x)^j$. In the zero-body-mass approximation, the post-stroke equations for $(\gamma,\theta-2UA_T)$ are homogeneous. The inertia <matrix> is positive definite by <Cauchy-Schwarz inequality>, and
$$
\det\mathsf K=m_T\int_0^Lm(x)(L-x)dx>0,\qquad
\operatorname{tr}(\mathsf M^{-1}\mathsf K)
=\frac{m_T[I_b+\int_0^Lm(x)(L-x)^2dx]}{\det\mathsf M}>0.
$$
The two <eigenvalues> of $\mathsf M^{-1}\mathsf K$ therefore have positive real parts: their sum and product are positive, whether they are real or conjugate. For $U>0$ the transient decays, proving parallel gliding and the displayed turn in this approximation.

With finite $M_b$, the angle is not a consequence of the printed <force> law for arbitrary $m(x)$. A concrete stable counterexample uses $L=1$, $\bar x=1/2$, and $m(x)=m_*x^2$. Then $M_0=m_*/3$, $M_1=m_*/12$, $B_0=m_*$, $B_1=m_*/2$, $B_2=m_*/4$, and $C=m_*^2/12$. Hence
$$
\theta_\infty=\frac{2UA_T}{1+2M_b/m_*},
$$
which differs from $2UA_T$ for positive body <mass>. This example has positive <determinant> and positive <matrix trace> of the relaxation <matrix>. Another immediate check is that if both endpoint added masses vanish, integrating the <force> law conserves total lateral <momentum>. A finite-mass fish cannot then end with $w=0$ and a nonzero new transverse <velocity>. Thus endpoint and inertia assumptions cannot silently be omitted.

If $Z$ is literally the <centre of mass> position of a deforming body, use a mass-centered deformation rather than the raw quadratic. For body <mass density> $\mu_b(x)$, its mean is $-\alpha J_2/M_b$, with $J_2=\int\mu_b r^2dx$; in the slender approximation $J_2=I_b$. The reference translation above is then $Z_r=Z+\alpha J_2/M_b$. Likewise the active <angular momentum> contains $-\dot\alpha J_3$, where $J_3=\int\mu_b r^3dx$, which vanishes for symmetric <mass> distribution. These corrections modify <derivative> forcing during the stroke. Since the shape and its time <derivative> return to zero, they do not remove the finite-body-mass qualification of the final impulse relation.

The principal physical limitations are small slopes and small total turning angle, prescribed approximately constant forward speed, slowly varying slender geometry, and neglected <viscosity>, separation and detailed three-dimensional wake interactions. Fast large-amplitude C-starts need more than this linear theory. Neglecting body <mass> is most reasonable for a laterally thin body whose crossflow <added mass> greatly exceeds its displaced <mass>. Stable relaxation also requires an appropriate tail/end geometry; it is not guaranteed for every added-mass profile.