$f(x)$, it turned out, was $x^2 \tan(x)$.

“That’s going to be a pain to differentiate,” said the student, sighing. Taylor series were not his favourite; differentiating trig functions just made matters worse.

“I have a trick,” said the Mathematical Ninja.

“Will it save me a lot of work?”

“It will.”

“Will it make Taylor series easy?”

“It will.”

“Will it guarantee me an A?”

“It won’t. But two out of three is pretty good.”

“It is. OK, then, ninja, bring it.”

The Mathematical Ninja glowered a little; he had tried to insist on being called ‘sensei’ in the past, but that had lasted only minutes. “Here’s the trick.”

“I’m listening.”

“Don’t differentiate $x^2 \tan(x)$. Differentiate $uv$.”

“That’s just product rule - you get $u^{\prime}v + v^{\prime}u$.”

“Yup. Then differentiate that.”

“Oh. Crikey. $u^{\prime\prime}v + u^{\prime}v^{\prime}$ for the first one, and $u^{\prime}v^{\prime} + uv^{\prime\prime}$ for the second - but you can join the middle two up, it’s $u^{\prime\prime}v + 2u^{\prime}v^{\prime} + uv^{\prime\prime}$.”

“Remind you of anything?”

“A bit Pascally, isn’t it?”

“Try the next one.”

“$u^{\prime\prime\prime}v + 3u^{\prime\prime}v + 3u^{\prime}v^{\prime\prime} + uv^{\prime\prime\prime}$. It works!”

“Well, you haven’t proved that. I’ll leave that as your homework.”

“Thanks. I’m not quite clear how this saves me time, though.”

“Ah! It saves you time because you can just work out the $u$ derivates and $v$ derivatives and multiply them together as needed.”

“Oh! That’s neat. $u^{\prime}$ is $2x$, $u^{\prime\prime} = 2$ and all of the further ones are 0. As for $v$, that’s $v^{\prime} = \sec^2(x)$, $v^{\prime\prime} = 2 \sec^2(x) \tan(x)$… then you need product rule again.”

“Yup.”

“$v^{\prime \prime \prime} = 2 \sec^4(x) + 4 \sec^2(x)\tan^2(x)$. Yuk.”

“Although you can turn the $\tan^2(x)$ into $\sec^2(x) - 1$ to make it easier.”

“Luckily I’m only doing it to three terms, eh?”

The Mathematical Ninja looked at the sword stashed in the corner of the classroom. He weighed up the benefits and costs, and decided the paperwork probably wouldn’t be worth it.