<s>[INST] Definite integral $\int_0^{\pi/12} \left( \frac{e^x \cos(x)}{\cos(x+\frac\pi4)} \right)^2 {\rm d}x= e^{\pi/6} \cos \left( \frac\pi6 \right) - \frac12$ 
$$
\int_0^{\pi/12} \left( \frac{e^x \cos(x)}{\cos(x+\frac\pi4)} \right)^2 {\rm d}x= e^{\pi/6} \cos \left( \frac\pi6 \right) - \frac12
$$

I've spent alot of time moving things around but I can't find a way to actually prove it... Would really appreciate some help.
$$
\int_0^{\pi/12} \left( \frac{e^x \cos(x)}{\cos(x+\frac\pi4)} \right)^2 {\rm d}x
\\= \int_0^{\pi/12} \frac{e^{2x}\cos^2(x)}{\frac12 (\cos(x)-\sin(x))^2}{\rm d}x
\\= 2\int_0^{\pi/12}e^{2x} \left( \frac{\cos(x)}{ \cos(x)-\sin(x)} \right)^2{\rm d}x
\\= \int_0^{\pi/12}e^{2x} \left( \frac{1 + \cos(2x)}{ 1-\sin(2x)} \right){\rm d}x
\\= \frac12 \int_0^{\pi/6} e^u \frac{1+\cos(u)}{1-\sin(u)} {\rm d}u
$$
 [/INST] I think integrating by parts works in most cases where there's a combination of $e^x$ and some other random function and of course we expect an elementary primitive. I will continue what you did:
$$I=\frac12 \int_0^\frac{\pi}{6} e^x \frac{1+\cos x}{\color{red}{1-\sin x}}dx=\frac12 \int_0^\frac{\pi}{6} e^x (1+\cos x)\color{red}{\left(\frac{\cos x}{1-\sin x}\right)'}dx$$
$$=\frac12  e^x (1+\cos x)\left(\frac{\cos x}{1-\sin x}\right)\bigg|_0^\frac{\pi}{6}-\frac12 \int_0^\frac{\pi}{6} e^x \frac{1-\sin x+\cos x}{1-\sin x}\cos xdx$$
$$=e^{\frac{\pi}{6}}\left(\frac34+\frac{\sqrt 3}2\right)-1-\frac12\int_0^\frac{\pi}{6}e^x\left(\cos x +\frac{{\cos^2 x}}{1-\sin x}\right)dx$$
$$=e^{\frac{\pi}{6}}\left(\frac34+\frac{\sqrt 3}2\right)-1-\frac12\int_0^\frac{\pi}{6}e^x(\cos x+1+\sin x)dx$$
$$=e^{\frac{\pi}{6}}\left(\frac34+\frac{\sqrt 3}2\right)-1-\frac12 e^x(1+\sin x)\bigg|_0^\frac{\pi}{6}$$$$=e^{\frac{\pi}{6}}\left(\frac34+\frac{\sqrt 3}2\right)-1-\frac34 e^\frac{\pi}{6}+\frac12=e^{\large \frac{\pi}{6}}\frac{\sqrt 3}{2}-\frac12 $$

Of course we also have:
$$\int e^x\frac{1+\cos x}{1-\sin x}dx=e^x(1+\cos x)\frac{\cos x}{1-\sin x}-e^x(1+\sin x)+C=\frac{e^x\cos x}{1-\sin x}+C$$
</s>