Find the polynomial if remainder is given If $f$ is a quintic polynomial which leaves remainder $1$ when divided by $(x-1)^3$, and $-1$ when divided by $(x+1)^3$ , then find the value of first derivative of $f$ at $x=2$.
My approach
Let $$ f = A(x-1)^5 + B(x-1)^4 + C(x-1)^3 +1 $$
Also 
$$ f = A(x+1)^5 + D(x+1)^4 + E(x+1)^3 -1$$
Is this method correct? Also I want to discuss other methods to solve these kind of problems.
 A: Another approach is the extended Euclidean algorithm to find the quintic $f,$ although there is now the possibility of fractions:
$$  \left(   x^{3}  + 3 x^{2}  + 3 x  + 1 \right)  \left(   \frac{ 3 x^{2}  - 9 x  + 8 }{ 16 }  \right)  -  \left(   x^{3}  - 3 x^{2}  + 3 x  - 1 \right)  \left(   \frac{ 3 x^{2}  + 9 x  + 8 }{ 16 }  \right)  =  \left( 1  \right)  $$ 
=================================================
$$  \left(   x^{3}  + 3 x^{2}  + 3 x  + 1 \right)  $$ 
$$  \left(   x^{3}  - 3 x^{2}  + 3 x  - 1 \right)  $$ 
$$  \left(   x^{3}  + 3 x^{2}  + 3 x  + 1 \right)  =  \left(   x^{3}  - 3 x^{2}  + 3 x  - 1 \right)  \cdot \color{magenta}{  \left( 1  \right) } +  \left(  6 x^{2}  + 2 \right)  $$ 
 $$  \left(   x^{3}  - 3 x^{2}  + 3 x  - 1 \right)  =  \left(  6 x^{2}  + 2 \right)  \cdot \color{magenta}{  \left(   \frac{  x  - 3 }{ 6 }  \right) } +  \left(   \frac{ 8 x  }{ 3 }  \right)  $$ 
 $$  \left(  6 x^{2}  + 2 \right)  =  \left(   \frac{ 8 x  }{ 3 }  \right)  \cdot \color{magenta}{  \left(   \frac{ 9 x  }{ 4 }  \right) } +  \left( 2  \right)  $$ 
 $$  \left(   \frac{ 8 x  }{ 3 }  \right)  =  \left( 2  \right)  \cdot \color{magenta}{  \left(   \frac{ 4 x  }{ 3 }  \right) } +  \left( 0 \right)  $$ 
 $$ \frac{ 0}{1} $$ 
 $$ \frac{ 1}{0} $$ 
 $$ \color{magenta}{  \left( 1  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left( 1  \right) }{ \left( 1  \right) } $$ 
 $$ \color{magenta}{  \left(   \frac{  x  - 3 }{ 6 }  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left(   \frac{  x  + 3 }{ 6 }  \right) }{ \left(   \frac{  x  - 3 }{ 6 }  \right) } $$ 
 $$ \color{magenta}{  \left(   \frac{ 9 x  }{ 4 }  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left(   \frac{ 3 x^{2}  + 9 x  + 8 }{ 8 }  \right) }{ \left(   \frac{ 3 x^{2}  - 9 x  + 8 }{ 8 }  \right) } $$ 
 $$ \color{magenta}{  \left(   \frac{ 4 x  }{ 3 }  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left(   \frac{  x^{3}  + 3 x^{2}  + 3 x  + 1 }{ 2 }  \right) }{ \left(   \frac{  x^{3}  - 3 x^{2}  + 3 x  - 1 }{ 2 }  \right) } $$ 
 $$  \left(   x^{3}  + 3 x^{2}  + 3 x  + 1 \right)  \left(   \frac{ 3 x^{2}  - 9 x  + 8 }{ 16 }  \right)  -  \left(   x^{3}  - 3 x^{2}  + 3 x  - 1 \right)  \left(   \frac{ 3 x^{2}  + 9 x  + 8 }{ 16 }  \right)  =  \left( 1  \right)  $$ 
A: $f$ is our quintic polynomial, and we have the following:
$$f=g \cdot (x-1)^3+1 \tag{1}$$
$$f = h \cdot (x+1)^3-1 \tag{2}$$
Where $g$ and $h$ are quadratic polynomials. 
Now, since we require $f'(2)$, let's just differentiate these 2 descriptions of $f$, and let's note that since $f$ is quintic, $f'$ is biquadratic. Therefore, we get
$$f'=(x-1)^2(g' \cdot (x-1)+3g) \tag{3}$$
$$f'=(x+1)^2(h' \cdot (x+1)+3h) \tag{4}$$
From $(3),(4)$ we see that $1$ and $-1$ are double roots of $f'(x)$. Therefore, necessarily
$$f'(x)=K(x-1)^2(x+1)^2=K(x^2-1)^2=K(x^4 - 2x^2 +1) \tag{5}$$
$$\implies f(x)=K\left(\frac{x^5}{5}-\frac{2x^3}{3}+x\right)+C$$
$$(1) \implies 1=f(1)=K\left(\frac{1}{5}-\frac{2}{3}+1\right)+C=\frac{8K}{15}+C \tag{6}$$
$$(2) \implies -1=f(-1)=K\left(-\frac{1}{5}+\frac{2}{3}-1\right)+C=-\frac{8K}{15}+C \tag{7}$$
From $(6),(7)$, we get $$C=0,\ K = \frac{15}{8} \implies f'(x)=\frac{15}{8}(x^2-1)^2, \ \ f(x)=\frac{1}{8}(3x^5 - 10x^3 + 15x)$$
And from $(5)$, we get $$f'(2)=\frac{15\cdot 9}{8}$$
