Coco12 said:
The graph looks like the green one. So I guess the reason why it would be squared is only for the y intercept
No, it's to have an x-intercept at x=-2.
\frac{(x+2)(x-2)(x-1)}{(x+2)(x-1)}
has a removable discontinuity at x=-2 (and x=1 but let's ignore this for a sec). If we cancel the common factors from the numerator and denominator then we're left with x-2 and plugging in x=-2 gives us -4. But we want (-2,0) to be a point of discontinuity, and not (-2,-4). The only way we can do this is if we end up with (x+2)p(x) where p(x) is any polynomial after cancelling all common factors, and the only way we can achieve this is by squaring the (x+2) factor.
All the information you're given was chosen to fit on a parabola (with discontinuities of course). For this reason, you don't even need to multiply your final expression by some constant.
So what I mean by this and how you would go about solving this problem is that since you're told an x-intercept is at x=2, but also that an x-intercept is at x=-2 since (-2,0) satisfies the equation after being simplified, from this information alone you know it needs to be of the form (x+2)(x-2) after simplification, and since it's a point discontinuity at x=-2, you also need to include the factors (x+2)/(x+2). Now you have
\frac{(x+2)^2(x-2)}{x+2}
But you're also told that a point discontinuity occurs at x=1, so the factors (x-1)/(x-1) also need to be included. Hence we have
\frac{(x-1)(x+2)^2(x-2)}{(x-1)(x+2)}
But we didn't even consider that the y-value of the point discontinuity at x=1 is -3. Well, is it? We plug in x=1 AFTER simplifying (because with the (x-1) factors we'd end up with 0/0) and we can also cancel out an x+2 factor from the numerator and denominator since we'd end up multiplying and dividing by the same number. So we have
(x+2)(x-2)
and plugging in x=1 gives -3
So it turns out that (1,-3) happens to lie on the parabola, hence we don't need a constant factor. For argument's sake, let's consider if this weren't the case. Say, if when we plugged in x=1 we ended up with y=-6, then since we need it to be y=-3 then we'd divide the rational function by 2 to get
\frac{(x-1)(x+2)^2(x-2)}{2(x-1)(x+2)}
Also finally, if we plug x=0, we're given the y-intercept and it also turns out to be y=-4, so the question was clearly constructed to work nicely given that you construct the rational function from the x-intercepts and point discontinuities only.