hand written solution, using integration by parts