We are given the integral:
\[
I = \int e^x \left( 1 + \tan x + \tan^2 x \right) dx
\]
We can split the integral into separate parts:
\[
I = \int e^x \, dx + \int e^x \tan x \, dx + \int e^x \tan^2 x \, dx
\]
Step 1: Solve the first part \( \int e^x \, dx \)
The integral of \( e^x \) is simply:
\[
\int e^x \, dx = e^x
\]
Step 2: Solve the second part \( \int e^x \tan x \, dx \)
To solve \( \int e^x \tan x \, dx \), we use integration by parts. Let:
- \( u = \tan x \), so \( du = \sec^2 x \, dx \)
- \( dv = e^x \, dx \), so \( v = e^x \)
Now apply integration by parts:
\[
\int e^x \tan x \, dx = e^x \tan x - \int e^x \sec^2 x \, dx
\]
The second part is just another standard integral, so this simplifies to:
\[
\int e^x \tan x \, dx = e^x \tan x - e^x
\]
Step 3: Solve the third part \( \int e^x \tan^2 x \, dx \)
This part can be rewritten as:
\[
\int e^x \tan^2 x \, dx = \int e^x (\sec^2 x - 1) \, dx = \int e^x \sec^2 x \, dx - \int e^x \, dx
\]
We already know the solution to \( \int e^x \, dx \), so we can use the result from earlier:
\[
\int e^x \tan^2 x \, dx = e^x \sec^2 x - e^x = e^x (\sec^2 x - 1)
\]
Step 4: Combine the results
Now, combining all parts of the integral:
\[
I = e^x + e^x \tan x - e^x + e^x \sec^2 x
\]
Simplifying:
\[
I = e^x \tan x + c
\]
Thus, the integral is:
\[
I = e^x \tan x + c
\]
Therefore, the correct answer is \( \boxed{e^x \tan x + c} \).