Step 1: Substitute $x=2t$:
Let $x=2t$, so $dx=2\,dt$.
Write the trig part using $1+\cos2t=2\cos^2t$ and $1+\sin2t=(\sin t+\cos t)^2$ (since $\sin^2t+\cos^2t+2\sin t\cos t=1+\sin2t$).
Step 2: Simplify the integrand:
\[ \frac{1+\sin2t}{1+\cos2t}=\frac{(\sin t+\cos t)^2}{2\cos^2t}=\frac{(\tan t+1)^2}{2} \]
So the integral becomes:
\[ \int e^{2t}\cdot\frac{(\tan t+1)^2}{2}\cdot2\,dt=\int e^{2t}(\tan t+1)^2\,dt \]
Step 3: Expand the square:
\[ (\tan t+1)^2=\tan^2t+2\tan t+1=\sec^2t+2\tan t \]
using $\tan^2t+1=\sec^2t$. So the integral is:
\[ \int e^{2t}\left(2\tan t+\sec^2t\right)dt \]
Step 4: Recognize an exact derivative:
Check that $\dfrac{d}{dt}\left(e^{2t}\tan t\right)=2e^{2t}\tan t+e^{2t}\sec^2t$, which is exactly the integrand.
\[ \int e^{2t}(2\tan t+\sec^2t)\,dt=e^{2t}\tan t+C \]
Now put back $t=x/2$: $e^{2t}=e^x$ and $\tan t=\tan(x/2)$.
Final Answer:
Both methods give the same antiderivative.
\[ \boxed{\int e^x\left(\frac{1+\sin x}{1+\cos x}\right)dx=e^x\tan\frac x2+C} \]