Find the remainder when $p(x)$ is divided by $x^2-a^2$ if $p(x)$ leaves remainders $a, -a$ when divided by $x+a, x-a$ 
Let $a\neq0$ and $p(x)$ be a polynomial of degree greater than $2$. If $p(x)$ leaves remainders $a$ and $-a$ when divided respectively by $x+a$ and $x-a$. Find the remainder when $p(x)$ is divided by $x^2-a^2$

$$
p(x)=q(x).(x+a)+r_1=q(x).(x+a)+a\quad\big[r_1=p(-a)=a\big]\\
p(x)=s(x).(x-a)+r_2=s(x).(x-a)-a\quad\big[r_2=p(a)=-a\big]\\
p(x)=t(x).(x^2-a^2)+r=t(x).(x^2-a^2)+Ax+B\\
p(a)=aA+B=-a\\
p(-a)=-aA+B=a\\
B=0,\;A=-1\implies r=Ax+B=-x
$$
I was wondering Is there another way to solve this problem ?

One possible approach would be to use partial fractions:
$$\frac{1}{x^2-a^2} = \frac{1}{2a} \left( \frac{1}{x-a} - \frac{1}{x+a}\right) .$$
On the other hand, by the given information,
$$\frac{p(x)}{x-a} = q_1(x) - \frac{a}{x-a}$$
and
$$\frac{p(x)}{x+a} = q_2(x) + \frac{a}{x+a}$$
for some quotient polynomials $q_1, q_2$.
Therefore,
$$ \frac{p(x)}{x^2-a^2} = \frac{1}{2a} \left( \frac{p(x)}{x-a} - \frac{p(x)}{x+a} \right) = \frac{1}{2a} \left( q_1(x) - q_2(x) - \frac{a}{x-a} - \frac{a}{x+a} \right) = \\
q(x) - \frac{x}{x^2 - a^2}$$
where $q(x) = \frac{1}{2a} (q_1(x) - q_2(x))$ is a polynomial.  It follows that the remainder of dividing $p(x)$ by $x^2 - a^2$ is $-x$.
