What is the solution set for the following system of equations?

[tex]\bf \begin{cases} y=x^2+4x-1\\ y=3x+1 \end{cases}~\hspace{5em}\stackrel{y}{x^2+4x-1}~~=~~\stackrel{y}{3x+1} \\\\\\ x^2+x-2=0\implies (x+2)(x-1)=0\implies x= \begin{cases} -2\\ 1 \end{cases} \\\\[-0.35em] ~\dotfill\\\\ \stackrel{\textit{when x = -2, using the 2nd equation}}{y=3(-2)+1\implies y=-5} \\\\\\ \stackrel{\textit{when x = 1, using the 2nd equation}}{y=3(1)+1\implies y=4} \\\\[-0.35em] \rule{34em}{0.25pt}\\\\ ~\hfill (-2,-5)\qquad (1,4)~\hfill[/tex]
Answer:
(-2, -5) and (1,4)
Step-by-step explanation:
The simpler equation is the second: it gives y as the linear function 3x + 1. Substitute this 3x + 1 for y in the first equation, obtaining
3x + 1 = x^2 + 4x - 1.
Move all terms from the left to the right: x^2 + 4x - 1 - 3x - 1, or:
x^2 + x - 2 = 0, which is in the form of a quadratic equation.
Factoring this equation, we get:
x^2 + x - 2 = 0. This factors as follows: (x+2)(x-1) = 0, so x = -2 and x = 1.
Now subst. 1 for x in y = 3x + 1: y = 3(1) + 1, or y = 4. Thus, (1,4) is one point of intersection of the two graphs. Next, find y for x = -2: y = 3(-2) + 1, or -5.
Thus, the 2 points of intersections of the graphs are (-2,-5) and (1,4).