Some equations are easy to figure out because you can add brackets around them, but sometimes it's really difficult!

For example this:

$\displaystyle e^{x^{2}}$

How do you find out what the inner and outer function is in order to apply the chain rule?

And what about integration by parts, if you want to integrate this:

$\displaystyle \int x\cdot \cos x dx$

How do you find out, which is the u and which is the v?