

For more general functions, people can refer the work by Prof. Roger Brockett, from Harvard University.
[If you find something wrong about the above solution, you are welcomed to send an email to me.]
Free online e-book for downloading. Most of these books are about mathematics, finance, stochastic finance, and so on. ALL ARE FREE.