# how to calculate integral of square of a function

When doing differentiation, I know that if $f$ is a function on $x$, then

$${ d \over dx } f^2 = 2 f {df \over dx}$$

so the opposite in integration is also clear:

$$\int 2 f { df \over dx } dx = f^2$$

I also know that

$$\int x^2 dx = { x^3 \over 3}$$

But I'm not sure as to how I can evaluate:

$$\int f^2 dx$$

I mean is there any identity for this? That the above is equal to another function of $f$ (such as $f^3 \over 3$ times something)? Is there any method to find this? I googled some but perhaps I wasn't using proper search terms so I didn't get any clear results so I'm asking here. [I hope my question is clear enough :-(]

Can't be done, in general. For example, it is easy to do $$\int xe^{x^2}\,dx$$ but there is no expression for $$\int x^2e^{2x^2}\,dx$$ in terms of the familiar functions of undergraduate mathematics.
• Hi thanks for replying. I'd like a couple of clarifications. I presume it is easy to evaluate $$\int x e^(x^2) dx$$ because it can be rearranged to be a product of the chain rule as $$\int {2xe^{x^2} \over 2} dx$$ whereas the second example cannot. But I am intrigued by your remark on "undergraduate" mathematics. Is there anything in higher level mathematics that can express the integral of the second example? – jamadagni Nov 26 '12 at 6:45
• Yes --- and, no. In higher level studies you just define a new function, the "error function", by ${\rm erf}(x)=\int_{-\infty}^xe^{-t^2}\,dt$ (or something like that), and then you can express the second integral in terms of erf. – Gerry Myerson Nov 26 '12 at 10:05