If Q(x)=x^2 for x less than or equal to 1

=ax+b for 1<x<2
= x^2-5 for x greater than or equal to 2

Find the values of a,b if Q(x) is to be continous for all x
Please help with this urgently and also show all working out on method to do it
Thanks

To ensure continuity, it is necessary that

Q(1-) equals Q(1+), or
The limit of Q(1) is the same when approached from the left or the right.

In the given case, the limits are polynomials which can both be evaluated at x=1.

Q(1-)=x^2=1
Q(1+)=a(1)+b
Q(1-)=Q(1+) => a+b=1

Similarly,
Q(2-)=a(2)+b=2a+b
Q(2+)=x^2-5=4-5=-1

We conclude that if Q(x) is continuous ∀x∈R, then the following conditions must be satisfied:
a+b=1 ....(1)
2a+b=-1....(2)
Solve the system of equations to find a and b.