To solve the integral \( \int e^x \sec x (1 + \tan x) \, dx \), we can use a substitution method based on the derivative of a function. Let's break it down step by step.
### Step 1: Rewrite the Integral
We start with the integral:
\[
\int e^x \sec x (1 + \tan x) \, dx
\]
We can rewrite \( (1 + \tan x) \) as \( \sec x + \sec x \tan x \):
\[
\int e^x \sec x (1 + \tan x) \, dx = \int e^x \sec x \, dx + \int e^x \sec x \tan x \, dx
\]
### Step 2: Identify the Function
Notice that the derivative of \( \sec x \) is \( \sec x \tan x \). This suggests that we can use integration by parts or a specific formula for integrals involving \( e^x \) and the derivative of a function.
### Step 3: Apply the Integration Formula
We can use the formula:
\[
\int e^x f(x) \, dx = e^x f(x) - \int e^x f'(x) \, dx
\]
where \( f(x) = \sec x \) and \( f'(x) = \sec x \tan x \).
### Step 4: Substitute into the Formula
Applying the formula:
\[
\int e^x \sec x \, dx = e^x \sec x - \int e^x \sec x \tan x \, dx
\]
Now, we can substitute this back into our original integral:
\[
\int e^x \sec x (1 + \tan x) \, dx = \int e^x \sec x \, dx + \int e^x \sec x \tan x \, dx
\]
This simplifies to:
\[
= \left( e^x \sec x - \int e^x \sec x \tan x \, dx \right) + \int e^x \sec x \tan x \, dx
\]
### Step 5: Simplify the Expression
Notice that the \( \int e^x \sec x \tan x \, dx \) terms cancel out:
\[
= e^x \sec x + C
\]
where \( C \) is the constant of integration.
### Final Answer
Thus, the integral evaluates to:
\[
\int e^x \sec x (1 + \tan x) \, dx = e^x \sec x + C
\]