I'm currently going through an article where I came across these two 1-D coupled differential equations.
$$\frac{dA}{dz} = a_1B(z)e^{-i\beta z} $$ $$\frac{dB}{dz} = a_2A(z)e^{i\beta z} $$
with these three conditions $$ \frac{d}{dz}(|A(z)|^2 +|B(z)|^2)=0 $$ $$ a_1 =-a_2^* $$ $$ B(0)=B_0, A(0)=0 $$ The article then skips all steps and arrived at these two solutions, subject to the three conditions, $$ A(z)=B_0\frac{2a_1e^{-i\beta z/2}}{\sqrt{4|a_1|^2+\beta^2}}sin\left(\frac{1}{2}\sqrt{4|a_1|^2+\beta^2}z \right) $$ $$ B(z)=B_0e^{i\beta z/2}\left[cos\left(\frac{1}{2}\sqrt{4|a_1|^2+\beta^2}z\right)-i\frac{\beta^2}{\sqrt{4|a_1|^2+\beta^2}}sin\left(\frac{1}{2}\sqrt{4|a_1|^2+\beta^2}z\right)\right] $$
Any idea on how the author arrived at these two expressions? I tried integrating by parts but ended up with $A'(z)$ and $\int{A(z)}$ terms that I can't get rid of. The author also made no mention of trial solutions. Any help is appreciated.
Multiply the first equation through by $\mathrm{e}^{\mathrm{i} \beta z}$ and differentiate. (We do the multiplication so that $B(z)$ doesn't appear multiplied by another expression depending on $z$ so we don't have to use the product rule and end up with terms depending on $B$ and $B'$.) \begin{align*} \frac{\mathrm{d}}{\mathrm{d}z} \left( \mathrm{e}^{\mathrm{i} \beta z} \frac{\mathrm{d}A}{\mathrm{d}z} \right) &= \frac{\mathrm{d}}{\mathrm{d}z} \left( a_1 B(z) \right) \\ \mathrm{i} \beta \mathrm{e}^{\mathrm{i} \beta z} A'(z) + \mathrm{e}^{\mathrm{i} \beta z} A''(z) &= a_1 B'(z) \\ &= a_1 a_2 \mathrm{e}^{\mathrm{i} \beta z} A(z) \end{align*} so $$ \mathrm{e}^{\mathrm{i} \beta z} \left( A''(z) + \mathrm{i} \beta A'(z) - a_1 a_2A(z) \right) = 0 \text{.} $$ Since $\mathrm{e}^{\mathrm{i} \beta z}$ is never zero (standard example of Picard's little theorem), we must have $$ A''(z) + \mathrm{i} \beta A'(z) - a_1 a_2 A(z) = 0 \text{.} $$ Using the side condition between $a_1$ and $a_2$, \begin{align*} A''(z) + \mathrm{i} \beta A'(z) &{}+ a_1 a_1^* A(z) = 0 \text{,}\\ A''(z) + \mathrm{i} \beta A'(z) &{}+ |a_1|^2 A(z) = 0 \text{.} \end{align*} This is a second order linear (autonomous, although we do not use this fact) ODE with constant coefficients, so we solve the characteristic equation, $$ r^2 + \mathrm{i} \beta r + |a_1|^2 = 0 \text{,} $$ obtaining \begin{align*} r &= \frac{-\mathrm{i} \beta \pm \sqrt{-\beta^2 - 4|a_1|^2}}{2} \\ &= \frac{-\mathrm{i}}{2} \left( \beta \pm \sqrt{\beta^2 + 4|a_1|^2} \right) \text{.} \end{align*} From this, \begin{align*} A(z) = C_1 \mathrm{e}^{\frac{-\mathrm{i}}{2} \left( \beta + \sqrt{\beta^2 + 4|a_1|^2} \right)z} + C_2 \mathrm{e}^{\frac{-\mathrm{i}}{2} \left( \beta - \sqrt{\beta^2 + 4|a_1|^2} \right)z} \text{.} \end{align*} Taking $z = 0$, the initial condition gives $C_1 + C_2 = 0$. Substituting this $A$ into the $\mathrm{d}B/\mathrm{d}z$ equation and simplifying a bit, we obtain \begin{align*} B(z) = \frac{\mathrm{i}}{2 a_1} \mathrm{e}^{\frac{-\mathrm{i}z}{2}\left(-\beta + \sqrt{\beta^2 + 4|a_1|^2} \right)} \left( C_1 \mathrm{e}^{\mathrm{i}(\sqrt{\beta^2 + 4|a_1|^2}) z} \left(-\beta + \sqrt{\beta^2 + 4|a_1|^2} \right) - C_2 \left( \beta + \sqrt{\beta^2 + 4|a_1|^2} \right) \right) \text{.} \end{align*} Taking $z=0$, substituting into the left of $B(0) = B_0$, using $C_2 = -C_1$, and simplifying, we obtain $$ C_1 = \frac{-\mathrm{i} a_1 B_0}{\sqrt{\beta^2 + 4|a_1|^2}} \text{.} $$
Substituting for $C_1$ and $C_2$, and simplifying, we obtain \begin{align*} A(z) &= \frac{\mathrm{i} a_1 B_0}{\sqrt{\beta^2 + 4|a_1|^2}} \left( \mathrm{e}^{\mathrm{i}\left(\sqrt{\beta^2 + 4|a_1|^2}\right)z/2} \right) \left( \mathrm{e}^{\mathrm{i}\left(\sqrt{\beta^2 + 4|a_1|^2}\right)z} - 1 \right) \\ B(z) &= \frac{B_0}{2\sqrt{\beta^2 + 4|a_1|^2}} \left( \mathrm{e}^{-\mathrm{i}\left(-\beta + \sqrt{\beta^2 + 4|a_1|^2}\right)z/2} \right) \left( \left( 1 - \mathrm{e}^{\mathrm{i}\left(\sqrt{\beta^2 + 4|a_1|^2}\right)z} \right) \beta + \left( 1 + \mathrm{e}^{\mathrm{i}\left(\sqrt{\beta^2 + 4|a_1|^2}\right)z} \right) \sqrt{\beta^2 + 4|a_1|^2} \right) \end{align*} (With a great deal of algebraic effort, we can show that the $z$ rate of change of the sum of the squared moduli of $A$ and $B$ is zero, showing that the first side condition is redundant.) Then use $\mathrm{e}^{\mathrm{i}\theta} = \cos(\theta) + \mathrm{i} \sin(\theta)$ and simplify (using one or two trig identities) and you get the answer you have.