Hi,
Yes you only need to write a backward function if:

You want to compute something that is not the “true” gradient that is computed by the autograd
Your forward function is not handled by the autograd (because you use custom function or third party library)

And the example in the tutorial is indeed artificial but it is just an example on how to do that for a simple function.