Some important points:-1. If $f$ is differentiable at $x=b$ then it's continuous $x=b$.
2. Every polynomial $P(x)$ is continuous at every real $x$ and $ \lim_{x \rightarrow c}P(x)= P(c)$
3. A function is continuous at $x=b \iff \lim_{x \rightarrow b^-}f(x) = \lim_{x \rightarrow b^+}f(x) = f(b)$.
Now we have to chosse $a $ and $b$ such that it makes the function continuous at $x=1$ and differentiable at $x=1$.
1. Continuity:-
$ \lim_{x \rightarrow 1^-}f(x) = \lim_{x \rightarrow 1^-}(ax + b) = a + b$
$ \lim_{x \rightarrow 1^+}f(x) = \lim_{x \rightarrow 1^-}(x^3 + x^1+1 ) = 1 + 1 + 1 = 3 = f(1)$
$f$ is right continous in order to make it left continuous, $a + b =3------(1)$
2. Diffentiability:-$f'(x)=\begin{cases}a, & x < 1\\3x^2 +2x, & x>1\end{cases}$
left hand derivative at $x = 1$ equals $a$ and right hand derivative at $x = 1$ equals $3(1)^2+2(1) = 5$.
The derivative exists $x=1\iff$ left and right hand derivatives exists and equal $x=1$.
So, $a=5$, substitute this value in $(1)$ which gives $b=-2$.
So the answer is $-2$.