# Taking the real part of a complex equation for sea level

I have the following complex equation that gives sea level as a function of time and space:

$$\zeta (x,t) = \left( \frac{hU_0}{\sqrt{gh}}\frac{e^{-idl}-e^{ikl}}{e^{idl}-e^{-idl}} \cdot e^{idx} - \frac{hU_0}{\sqrt{gh}}\frac{e^{ikl}-e^{idl}}{e^{idl}-e^{-idl}} \cdot e^{-idx} +\frac{hU_0k}{\sigma}e^{ikx} \right) \cdot e^{- i \sigma t},$$

where $d=\frac{\sigma}{\sqrt{gh}}$, $k$ is the wave number, $l$ is the length of the basin. This is in complex form, and my solution is the real part of this equation. My question is, do you know how to get to the real part? I have tried by first writing all $e^{i something}$ as $cos(something)+isin(something)$, then multiplying, adding... all of the parts and then finally just taking the bits that don't have the imaginary unit next to them, but the solution seems dodgy to me. I have checked it and can't find what (or if) I did wrong and I would appreciate it if somebody else could take a look at it.

The result I get is the following: $$Re[\zeta] =\frac{hU_0k}{\sigma} cos(kx-\sigma t)-\frac{hU_0}{\sqrt{gh}} \frac{cos(dx)}{sin(dl)}sin(kl-\sigma t)-\frac{hU_0}{\sqrt{gh}}\frac{cos(dl-dx)}{sin(dl)}sin(\sigma t).$$

• Where did you get that formula? – Jan Mar 7 '17 at 14:59
• Do you just have a different form of the answer? How do you know it mightn't be right? – snulty Mar 7 '17 at 15:12
• I got the formula by solving the momentum equations with sinusoidal atmospheric pressure forcing. The first equation is correct, it's the final result that seems off to me. I don't actually know if it's off (the final pairings don't seem logical to me), it's possible it is correct, which is why I'm asking someone to take a look at it. – Rehu Mar 7 '17 at 15:49

One thing I would expect to be useful is $e^{idl}-e^{-idl}=2i\sin(dl)$ since that's on your denominator.

$$\zeta (x,t) = \left(A\frac{e^{-idl}-e^{ikl}}{e^{idl}-e^{-idl}} \cdot e^{idx} - A\frac{e^{ikl}-e^{idl}}{e^{idl}-e^{-idl}} \cdot e^{-idx} +Be^{ikx} \right) \cdot e^{- i \sigma t},$$

where $A= \frac{hU_0}{\sqrt{gh}}$ and $B=\frac{hU_0k}{\sigma}$ are real I assume.

Tidying up a bit:

$$\zeta (x,t) = \frac{A}{2i\sin(dl)}\left(e^{-id(l-x)- i \sigma t}-e^{ikl+idx- i \sigma t} - e^{ikl-idx- i \sigma t}+e^{id(l-x)- i \sigma t}\right) +Be^{ikx- i \sigma t}$$

You can use that

$\mathrm{Re}(e^{ix})=\cos(x), \quad\mathrm{Im}(e^{ix})=\sin(x),\quad \mathrm{Re}(ie^{ix})=-\sin(x),\quad \mathrm{Im}(ie^{ix})=\cos(x).$

$$=-\frac{A}{2\sin(dl)}\left[-\sin(-d(l-x)-\sigma t)+\sin(kl+dx- \sigma t) +\sin(kl-dx-\sigma t)+\sin(d(l-x)-\sigma t)\right] +B\cos(kx-\sigma t)$$

$$= \frac{-A}{2\sin(dl)}\left[\sin(d(l-x)+\sigma t)+\sin(kl+dx- \sigma t) +\sin(kl-dx-\sigma t)-\sin(d(l-x)-\sigma t)\right] \\+B\cos(kx-\sigma t)$$

You can then pair up the sines then and use the sine addition rules.

$$\sin(A)\pm \sin(B)=2\sin\left(\frac{A\pm B}{2}\right)\cos\left(\frac{A\mp B}{2}\right)$$

I think it would be natural to pair the first and last terms and the middle two terms, because things will cancel.

$$= \frac{-A}{\sin(dl)}\left[\sin(kl- \sigma t)\cos(dx) +\cos(d(l-x))\sin(\sigma t)\right] +B\cos(kx-\sigma t)$$

Which is what you have I believe.

• Thank you for that. I was afraid I had done something wrong because the way the terms are paired in the end seems off. (After all the equations I have solved during my studies, it just seems the A part of the result should be more "symmetric.) – Rehu Mar 7 '17 at 15:53
• @Rehu if you're wondering about symmetry, I think you have to have some to begin with for it to be preserved. If you look though the terms multiplying $A$ in the beginning, they're essentially the same with $d$ replaced by $-d$. This substitution actually interchanges the two terms and gives an overall minus sign (essentially due to the sine on the denominator). That symmetry say is still present in the real part. Swap $d\mapsto -d$ and you'll notice that the terms multiplying $A$ change to minus the same thing overall. I'm not sure what other symmetries to check. – snulty Mar 7 '17 at 16:22