To solve the inequality \( |x + \frac{1}{x}| < 4 \), we will break it down step by step.
### Step 1: Rewrite the Inequality
We start with the inequality:
\[
|x + \frac{1}{x}| < 4
\]
This can be interpreted as:
\[
-4 < x + \frac{1}{x} < 4
\]
### Step 2: Solve the Right Side of the Inequality
First, we solve:
\[
x + \frac{1}{x} < 4
\]
To eliminate the fraction, we multiply through by \( x \) (noting that \( x \) must not be zero):
\[
x^2 + 1 < 4x
\]
Rearranging gives:
\[
x^2 - 4x + 1 < 0
\]
### Step 3: Find the Roots of the Quadratic
Now we will find the roots of the quadratic equation \( x^2 - 4x + 1 = 0 \) using the quadratic formula:
\[
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\]
Here, \( a = 1, b = -4, c = 1 \):
\[
x = \frac{4 \pm \sqrt{(-4)^2 - 4 \cdot 1 \cdot 1}}{2 \cdot 1} = \frac{4 \pm \sqrt{16 - 4}}{2} = \frac{4 \pm \sqrt{12}}{2} = \frac{4 \pm 2\sqrt{3}}{2} = 2 \pm \sqrt{3}
\]
Thus, the roots are \( 2 - \sqrt{3} \) and \( 2 + \sqrt{3} \).
### Step 4: Test Intervals
Next, we need to test the intervals determined by these roots:
1. \( (-\infty, 2 - \sqrt{3}) \)
2. \( (2 - \sqrt{3}, 2 + \sqrt{3}) \)
3. \( (2 + \sqrt{3}, \infty) \)
We will test a point from each interval in the inequality \( x^2 - 4x + 1 < 0 \).
- For \( x = 0 \) (in the interval \( (-\infty, 2 - \sqrt{3}) \)):
\[
0^2 - 4(0) + 1 = 1 > 0 \quad \text{(not a solution)}
\]
- For \( x = 2 \) (in the interval \( (2 - \sqrt{3}, 2 + \sqrt{3}) \)):
\[
2^2 - 4(2) + 1 = 4 - 8 + 1 = -3 < 0 \quad \text{(solution)}
\]
- For \( x = 5 \) (in the interval \( (2 + \sqrt{3}, \infty) \)):
\[
5^2 - 4(5) + 1 = 25 - 20 + 1 = 6 > 0 \quad \text{(not a solution)}
\]
Thus, the solution for the right side is:
\[
x \in (2 - \sqrt{3}, 2 + \sqrt{3})
\]
### Step 5: Solve the Left Side of the Inequality
Now we solve:
\[
x + \frac{1}{x} > -4
\]
Multiplying through by \( x \) (again noting \( x \neq 0 \)):
\[
x^2 + 1 > -4x
\]
Rearranging gives:
\[
x^2 + 4x + 1 > 0
\]
### Step 6: Find the Roots of the Quadratic
We find the roots of \( x^2 + 4x + 1 = 0 \):
\[
x = \frac{-4 \pm \sqrt{4^2 - 4 \cdot 1 \cdot 1}}{2 \cdot 1} = \frac{-4 \pm \sqrt{16 - 4}}{2} = \frac{-4 \pm \sqrt{12}}{2} = \frac{-4 \pm 2\sqrt{3}}{2} = -2 \pm \sqrt{3}
\]
Thus, the roots are \( -2 - \sqrt{3} \) and \( -2 + \sqrt{3} \).
### Step 7: Test Intervals
We test the intervals determined by these roots:
1. \( (-\infty, -2 - \sqrt{3}) \)
2. \( (-2 - \sqrt{3}, -2 + \sqrt{3}) \)
3. \( (-2 + \sqrt{3}, \infty) \)
- For \( x = -4 \) (in the interval \( (-\infty, -2 - \sqrt{3}) \)):
\[
(-4)^2 + 4(-4) + 1 = 16 - 16 + 1 = 1 > 0 \quad \text{(solution)}
\]
- For \( x = -2 \) (in the interval \( (-2 - \sqrt{3}, -2 + \sqrt{3}) \)):
\[
(-2)^2 + 4(-2) + 1 = 4 - 8 + 1 = -3 < 0 \quad \text{(not a solution)}
\]
- For \( x = 0 \) (in the interval \( (-2 + \sqrt{3}, \infty) \)):
\[
0^2 + 4(0) + 1 = 1 > 0 \quad \text{(solution)}
\]
Thus, the solution for the left side is:
\[
x \in (-\infty, -2 - \sqrt{3}) \cup (-2 + \sqrt{3}, \infty)
\]
### Step 8: Combine the Solutions
The overall solution set for the inequality \( |x + \frac{1}{x}| < 4 \) is the intersection of the two solution sets:
\[
x \in (2 - \sqrt{3}, 2 + \sqrt{3}) \cup (-\infty, -2 - \sqrt{3}) \cup (-2 + \sqrt{3}, \infty)
\]
### Final Solution
Thus, the solution set is:
\[
x \in (-\infty, -2 - \sqrt{3}) \cup (2 - \sqrt{3}, 2 + \sqrt{3}) \cup (-2 + \sqrt{3}, \infty)
\]