Given the square of the algebraic formula x + ax + B, when x = - 1, its value is 5; when X-1, its value is - 1. Find the value of a and B

Given the square of the algebraic formula x + ax + B, when x = - 1, its value is 5; when X-1, its value is - 1. Find the value of a and B

x=-1
1-a+b=5
a-b=-4 (1)
x=1
1+a+b=-1
a+b=-2 (2)
Add
2a=2
a=1
b=-2-a=-3