Today in Calc, we stumbled upon two anti derivatives (2 students had different approaches which we worked out) which are: $$ \ln \left| \frac{\sin x - 1 - \cos x + \sqrt 2 + \sqrt 2 \cos x}{\sin x - 1 - \cos x - \sqrt 2 - \sqrt 2 \cos x} \right| $$ and $$ \ln \left| \frac{2 - \sqrt 2 \cos x + \sqrt 2 \sin x}{\sqrt 2 \sin x + \sqrt 2 \cos x} \right|. $$
It turns out (fortunately) they they only differ by a constant, which according to the TI is approximately $0.88137358$ after taking the difference of their graphs. But to show algebraically that they are equal, I tried several approaches, but failed. Also, I am interested what that constant in exact terms would be. Jokingly, I told my students to do this for homework as we ran out of time, but honestly this one stumps me too. So please, any suggestions from you great thinkers out there?
If we assume that both results are correct, then we just need to evaluate the following difference at a particular value of $x$.
\begin{eqnarray*} C &=&\ln \left\vert \frac{2-\sqrt{2}\cos x+\sqrt{2}\sin x}{\sqrt{2}\sin x+ \sqrt{2}\cos x}\right\vert \\ &&-\ln \left\vert \frac{\sin x-1-\cos x+\sqrt{2}+\sqrt{2}\cos x}{\sin x-1-\cos x-\sqrt{2}-\sqrt{2}\cos x}\right\vert \\ &=&\ln \left\vert \frac{2-\sqrt{2}\cos x+\sqrt{2}\sin x}{\sqrt{2}\sin x+ \sqrt{2}\cos x}\left( \frac{\sin x-1-\cos x+\sqrt{2}+\sqrt{2}\cos x}{\sin x-1-\cos x-\sqrt{2}-\sqrt{2}\cos x}\right) ^{-1}\right\vert . \end{eqnarray*}
For $x=0$ we find $C=\ln |- \left( \sqrt{2}+1\right)|=\ln \left( \sqrt{2}+1\right).$
If we want to prove that the two antiderivatives differ by a constant, then we can express $\sin x$ and $\tan x$ in terms of $t=\tan \frac{x}{2}$ to obtain a rational function in $t$, which we will then simplify until we get a constant. Since
\begin{eqnarray*} \sin x &=&\frac{2\tan \frac{x}{2}}{1+\tan ^{2}\frac{x}{2}}=\frac{2t}{1+t^{2}} \\ \cos x &=&\frac{1-\tan ^{2}\frac{x}{2}}{1+\tan ^{2}\frac{x}{2}}=\frac{1-t^{2} }{1+t^{2}}, \end{eqnarray*}
we have that
\begin{eqnarray*} C &=&\ln \left\vert \frac{\left( 2-\sqrt{2}\frac{1-t^{2}}{1+t^{2}}+2\sqrt{2} \frac{t}{1+t^{2}}\right) \left( 2\frac{t}{1+t^{2}}-1-\frac{1-t^{2}}{1+t^{2}}- \sqrt{2}-\sqrt{2}\frac{1-t^{2}}{1+t^{2}}\right) }{\left( 2\sqrt{2}\frac{t}{ 1+t^{2}}+\sqrt{2}\frac{1-t^{2}}{1+t^{2}}\right) \left( 2\frac{t}{1+t^{2}}-1- \frac{1-t^{2}}{1+t^{2}}+\sqrt{2}+\sqrt{2}\frac{1-t^{2}}{1+t^{2}}\right) } \right\vert \\ &=&\ln \left\vert \frac{-\frac{\sqrt{2}}{2}\left( t-1-\sqrt{2}\right) \left( 2+\sqrt{2}\right) \left( t+\sqrt{2}-1\right) ^{2}}{\left( t-1+\sqrt{2} \right) \left( -2t-1+t^{2}\right) }\right\vert \\ &=&\ln \left\vert \frac{-\frac{\sqrt{2}}{2}\left( 2+\sqrt{2}\right) \left( -2t-1+t^{2}\right) }{\left( -2t-1+t^{2}\right) }\right\vert \\ &=&\ln \left\vert -\left( \sqrt{2}+1\right) \right\vert \\ &=&\ln \left( \sqrt{2}+1\right) . \end{eqnarray*}