When the polynomial $f(x)$ is divided by $x - 3,$ the remainder is 15.  When $f(x)$ is divided by $(x - 1)^2,$ the remainder is $2x + 1.$  Find the remainder when $f(x)$ is divided by $(x - 3)(x - 1)^2.$
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
When the polynomial $f(x)$ is divided by $x - 3,$ the remainder is 15.  When $f(x)$ is divided by $(x - 1)^2,$ the remainder is $2x + 1.$  Find the remainder when $f(x)$ is divided by $(x - 3)(x - 1)^2.$
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2x^2 - 2x + 3
When the polynomial $f(x)$ is divided by $x - 3,$ the remainder is 15.  When $f(x)$ is divided by $(x - 1)^2,$ the remainder is $2x + 1.$  Find the remainder when $f(x)$ is divided by $(x - 3)(x - 1)^2.$
train