I have the following task: calculate the coordinates of the intersections point between a straight line with a given slope and a quadratic function, so that you only receive one intersection instead of the normal two or none.
I am given the slope gradient m and the quadratic equation.
In this example its
y=x^2+3x-2 m=1
Let the equation of straight line be $y = mx +c$. Solve for the intersection: $$ mx+c = x^2 +3x -2$$ You get a quadratic in x. $$ x^2 + (3-m) x -(2+c) = 0$$
To have only one intersection point, there should be only value of $x$ satisfying the above equation. So you make the discriminant of the above equation zero.
So now your x is simply $(m-3)/2$.
You know the value of $m$, so you know $x$, then you can find $y$ to know the intersection point