# Find the number of distinct real roots

#### anemone

##### MHB POTW Director
Staff member
Let $f(x)=x^3-3x+1$. Find the number of distinct real roots of the equation $f(f(x))=0$.

#### jacks

##### Well-known member

I am getting Total no. of real solution is $= 7$

Is is Right or not

Thanks

#### mathbalarka

##### Well-known member
MHB Math Helper
Quite a nice bit of a problem you've got there. Here's my solution --

Finding the real roots of $$\displaystyle f(f(x)) = 0$$ is equivalent to finding the ones of $$\displaystyle f(x) = x_i$$ where $$\displaystyle x_i$$ for i = 1, 2, 3 are the (real) roots of f(x).

We see that the roots of $$\displaystyle f(x)$$ are all real as the discriminant is positive. An inspection of $$\displaystyle f(x) = x^3 - 3x + 1$$ can be considered at the intervals $$\displaystyle [-2, -1] \cup [-1, 0] \cup [0, 1] \cup [1, 2]$$ to find out that three roots lie precisely in between the first, third and the fourth interval.

Note that for the equation $$\displaystyle f(x) = x_i$$ to have all real root, the discriminant must be positive, implying the $$\displaystyle -2 \leq 1 - x_i \leq 2$$. The first root lies between [-2, -1], so $$\displaystyle 1 - x_1$$ lies in between 2 and 3 and hence the discriminant comes down to a negative value, so one real root here exists and the other twos are complex conjugates of each other in $$\displaystyle \mathbb{C}$$.

For the second root, it lies between 0 and 1, so $$\displaystyle 1 - x_2$$ lies in between 2 and -2 obviously enough. The same applies for the third root. So we have 3 real roots each for these two.

So, the total number of real roots are 1 + 3 + 3 = 7.

Balarka
.

Last edited by a moderator:

#### anemone

##### MHB POTW Director
Staff member

I am getting Total no. of real solution is $= 7$

Is is Right or not

Thanks
Yes, 7 is the correct answer! #### anemone

##### MHB POTW Director
Staff member
Finding the real roots of $$\displaystyle f(f(x)) = 0$$ is equivalent to finding the ones of $$\displaystyle f(x) = x_i$$ where $$\displaystyle x_i$$ for i = 1, 2, 3 are the (real) roots of f(x).

.

Hey Balarka,

I really like it you mentioned that to solve for $x$ in $$\displaystyle f(f(x)) = 0$$ is equivalent to solve for $$\displaystyle f(x) = x_i$$ where $$\displaystyle x_i$$ for i = 1, 2, 3 are the (real) roots of f(x).

And if I may use this idea to solve for the problem, I found out the total number of real roots for $$\displaystyle f(f(x)) = 0$$ are 7 as well, and this method is so much better than my first approach and thank you, Balarka for showing me something that I don't know! Solving for the number of real roots of $$\displaystyle f(x) = x_1=root_1$$ means the same thing as finding the number of intersection points between the curve $y=f(x)$ and $y=root_1$, as shown by the green line and we see that in this case we have only one real root for $$\displaystyle f(x) = x_1=root_1$$. Solving for the number of real roots of $$\displaystyle f(x) = x_2=root_2$$ means the same thing as finding the number of intersection points between the curve $y=f(x)$ and $y=root_2$, as shown by the purple line and we see that in this case we have only one real root for $$\displaystyle f(x) = x_2=root_2$$. Solving for the number of real roots of $$\displaystyle f(x) = x_3=root_3$$ means the same thing as finding the number of intersection points between the curve $y=f(x)$ and $y=root_3$, as shown by the orange line and we see that in this case we have only one real root for $$\displaystyle f(x) = x_3=root_3$$.

So there are a total of 7 intersection points and hence there are 7 real roots for $$\displaystyle f(f(x)) = 0$$!

Thanks!

#### mathbalarka

##### Well-known member
MHB Math Helper
anemone said:
this method is so much better than my first approach
May I see your approach on this problem?

Balarka
.

#### anemone

##### MHB POTW Director
Staff member
May I see your approach on this problem? Balarka .
My first approach revolves around checking the nature of the curve of the function of $f(f(x))$ from its first and second derivative expression. If we let $f(x)=x^3-3x+1$ and $g(x)=f(f(x))=(f(x))^3-3(f(x))+1$, we find

 $f(x)=x^3-3x+1$ $g(x)=f(f(x))=(f(x))^3-3(f(x))+1$ $f'(x)=3x^2-3=3(x^2-1)=3(x+1)(x-1)$ $\rightarrow f'(x)=0$ iff $3(x+1)(x-1)=0$ or $x=\pm1$. $g'(x)=3f(x)^2f'(x)-3f'(x)=3f'(x)((f(x))^2-1)$ $\rightarrow g'(x)=0$ iff $x=\pm1$, $x=\pm \sqrt{3}$, or $x=-2$ or $x=0$. $f''(x)=6x$ $g''(x)=6f(x)(f'(x))^2+3f''(x)((f(x))^2-1)$

I then made another table to determine the nature of the critical points as follows:
 $x$ -2 $-\sqrt{3}$ -1 0 1 $\sqrt{3}$ $f(x)$ -1 1 3 1 -1 1 $f'(x)$ 9 6 0 -3 0 6 $f''(x)$ -12 $-6\sqrt{3}$ -6 0 6 $6\sqrt{3}$ $g(x)$ 3 -1 19 -1 3 -1 $g'(x)$ 0 0 0 0 0 0 $g''(x)$ -486 216 -144 54 0 216

And plot a rough sketch to determine the number of real roots of the function of $f(f(x))=0$: From the graph we can tell there are 7 real roots of the function of $f(f(x))=0$.

#### mathbalarka

##### Well-known member
MHB Math Helper
Hmm... very nice. I like the way you analyzed the behavior of f(f(x)), very well done. Mine may have been a little time consuming but this one is more representative.

PS I particularly like this solution. #### anemone

##### MHB POTW Director
Staff member
Hmm... very nice. I like the way you analyzed the behavior of f(f(x)), very well done. Mine may have been a little time consuming but this one is more representative.

PS I particularly like this solution. Thank you for the compliment, Balarka! And I must give full credit to Opalg, a very nice mentor here for giving me idea (from another question) to solve the problem!