The question is: When we're both stock values the same? Then all you have to do is match both equations and solve for x, like this
[tex]\begin{gathered} A(x)=x^2-6x+20 \\ B(x)=3x+2 \\ \text{ Matching you have} \\ x^2-6x+20=3x+2 \\ \text{Subtract 3x from both sides of the equation} \\ x^2-6x+20-3x=3x+2-3x \\ x^2-9x+20=2 \end{gathered}[/tex][tex]\begin{gathered} \text{Now subtract 2 from both sides of the equation} \\ x^2-9x+20-2=2-2 \\ x^2-9x+18=0 \end{gathered}[/tex]
Factoring the trinomial you get
[tex]x^2-9x+18=(x-6)(x-3)=0[/tex]
Which implies that
[tex]\begin{gathered} x-6=0 \\ x=6 \\ \text{ or} \\ x-3=0 \\ x=3 \end{gathered}[/tex]
Therefore, since x corresponds to the number of months, then the values of the two shares were equal at 3 and at 6 months.