The hyperbolic tangent function tanh, where e^(-2r) tanh(2) = e^r + e^(-r), is used as an activation function for neural networks to determine the output (in the interval [-1,1]) of each neuron based on its inputs. The derivative of tanh is given by: tanh'(z) = 1 - tanh^2(z).
a) By hand, find the first three Taylor polynomials P0(x), P1(x), and P2(x) of tanh(x) about the point 0.
b) Using Matlab, plot tanh(w), P0(w), P1(w), and P2(w) for the interval [-T, w].