Solution (source code)

= Solution

Let $g(x)=\tan(x+\pi/4)$. The <derivative> identity for <tangent> gives $g'=1+g^2$, so $g(0)=1$, $g'(0)=2$, and $g''(0)=2g(0)g'(0)=4$. Its first three nonzero <Taylor expansion> terms are therefore
$$
\boxed{\tan(x+\pi/4)=1+2x+2x^2+O(x^3).}
$$
The factor $1/2!$ on the second <derivative> is what turns $g''(0)=4$ into the coefficient $2$.