Find out |a+p+b+q| for the following question. Let$$f(x)=\begin{cases}
    ax(x-1)+b&;x\lt1\\
    x+2&;1\le x\le3\\
    px^2+qx+2&;x\gt3
\end{cases}$$ is continuous for all x belongs to R except $x=1$ but $|f(x)|$ is differentiable everywhere and $f'(x)$ is continuous at x=3 and $|a+p+b+q|=k$, then k=?


$f′(x)$ is continuous at $x=3$

So derivatives of $x+2$ and $px^2 + qx + 2$ must be equal.
$1=2px + q$; $x=3$
$\boxed{1=6p + q}$

continuous for all x belongs to R except x=1
  but |f(x)|
   is differentiable everywhere

So it's graph should be like this (drawed very roughly, slopes should be equal at $x=1$)

If $x+2$ is positive at $x=1$, then $ax(x−1)+b$ must be negative.
If $x+2$ is negative at $x=1$, then $ax(x−1)+b$ must be positive.
So $ax(x−1)+b = -x-2$ for $x=1$
$a(0) + b = -3$
$\boxed{b=-3}$
Also the derivatives of $ax(x−1)+b$ and $-x-2$ must be equal too. (at $x=1$)
$2ax-a= -1$
$\boxed{a= -1}$
Jump to

$f′(x)$ is continuous at $x=3$

$x+2$ and $px^2 + qx + 2$ must be equal for $x=3$
$9p + 3q + 2 = 5$
$\boxed{3p + q = 1}$
Remember, we found that $1=6p + q$
Solving system of equations $1=6p + q$ and $3p + q = 1$
$\boxed{p=0,q=1}$
Now, $|0+1-1-3| = 3$, the answer should be $3$.
And our function is:
$$f(x)=\begin{cases}
    -x(x-1)-3&;x\lt1\\
    x+2&;1\le x\le3\\
    x+2&;x\gt3
\end{cases}$$
