Help computing the following integral

Click For Summary
SUMMARY

The forum discussion focuses on computing the integral $$\int_R e^{-\frac{(x-y)^2}{4t}}y^2dy$$, which is related to the solution of the 1D heat equation with an initial distribution of $$x^2$$. Participants explore various methods, including substitutions and Feynman's trick, to evaluate the integral. The final result is established as $$x^2 + 2t$$, demonstrating the integral's connection to Gaussian functions and the heat equation. The discussion emphasizes the importance of recognizing integral forms and applying appropriate techniques for evaluation.

PREREQUISITES
  • Understanding of Gaussian integrals and their properties.
  • Familiarity with the 1D heat equation and its solutions.
  • Knowledge of integration techniques, including substitution and integration by parts.
  • Basic concepts of polar coordinates in multivariable calculus.
NEXT STEPS
  • Study Gaussian integrals and their applications in probability and statistics.
  • Learn about Feynman's trick for evaluating integrals involving parameters.
  • Explore the derivation and solutions of the heat equation in various dimensions.
  • Investigate the error function and its relationship to Gaussian integrals.
USEFUL FOR

Mathematicians, physicists, and students studying calculus, particularly those interested in differential equations and integral calculus. This discussion is beneficial for anyone looking to deepen their understanding of Gaussian integrals and their applications in real-world problems.

docnet
Messages
796
Reaction score
486
Homework Statement
Can this gaussian integral be solved?
Relevant Equations
$$\int^{\frac{x}{\sqrt{t}}}_0e^{-\frac{s^2}{4}}ds+d$$
Solution attempt:

we make the substitution ##\frac{s}{2}=u## and ##ds=2du## to compute
$$\Big(2\int^{\frac{2x}{\sqrt{t}}}_0e^{-u^2}du\Big)^2=2\int^{\frac{2x}{\sqrt{t}}}_0e^{-u^2}du2\int^{\frac{2x}{\sqrt{t}}}_0e^{-v^2}dv=4\int^{\frac{2x}{\sqrt{t}}}_0\int^{\frac{2x}{\sqrt{t}}}_0e^{-(u^2+v^2)}dudv$$we consider the function ##e^{-r^2}## on the plane ##R^2## and compute the integral

$$4\int\int_{[0,{\frac{2x}{\sqrt{t}}}]\times[0,{\frac{2x}{\sqrt{t}}}]}e^{-r^2}rdrd\theta$$
 
Physics news on Phys.org
Nice work to convert to polar coordinates! That's often the best first thing to try for Gaussian integrals.

You should be able to calculate the indefinite integral for the inner integral.

Next you need to convert your integration limits to polar coordinates.

The r integration interval will have lower limit 0.
Since the integration area lies in the first quadrant, the theta integral will have limits ##0,\pi/2## but you can use symmetry of the area around the line ##v=u## to integrate for ##\theta\in[0,\pi/4]## and double the result.
It remains to calculate the upper limit for the r integral, as a function of ##\theta##. Drawing a diagram of the integration area will help there.

After that you will have an integral over ##\theta## to perform, which hopefully is not too hard - but can't be sure without first doing the above.
 
  • Like
Likes   Reactions: docnet
Solution attempt:

we make the substitution ##\frac{s}{2}=u## and ##ds=2du## to compute
$$\Big(2\int^{\frac{2x}{\sqrt{t}}}_0e^{-u^2}du\Big)^2=2\int^{\frac{2x}{\sqrt{t}}}_0e^{-u^2}du2\int^{\frac{2x}{\sqrt{t}}}_0e^{-v^2}dv=4\int^{\frac{2x}{\sqrt{t}}}_0\int^{\frac{2x}{\sqrt{t}}}_0e^{-(u^2+v^2)}dudv$$we consider the function ##e^{-r^2}## on the plane ##R^2## and compute the integral

$$4\int\int_{[0,{\frac{2x}{\sqrt{t}}}]\times[0,{\frac{2x}{\sqrt{t}}}]}e^{-r^2}rdrd\theta$$
we set the boundaries of the integral using ##\theta\in[0,\frac{\pi}{4}]## and ##r\in[0,\frac{2\pi}{\sqrt{t}cos\theta}]## and put a 2 before the integral
$$8\int_0^{\frac{\pi}{4}}\int_0^{\frac{2\pi}{\sqrt{t}cos\theta}} re^{-r^2}drd\theta$$ we make exchanges using ##\clubsuit=-r^2## and ##d\clubsuit=-2rdr## to evaluate the inner integral

$$-\frac{1}{2}\int e^{\clubsuit}d\clubsuit=-\frac{e^\clubsuit}{2}\Rightarrow-\frac{e^{-r^2}}{2}\Rightarrow \frac{1}{2}-\frac{e^{-\frac{4\pi^2}{tcos^2\theta}}}{2}$$giving
$$8\int_0^{\pi/4}\Big[\frac{1}{2}-\frac{e^{-\frac{4\pi^2}{tcos^2\theta}}}{2}\Big]d\theta=\pi+4\int_0^{\pi/4}e^{-\frac{4\pi^2}{tcos^2\theta}}d\theta$$
 
docnet said:
Solution attempt:

we make the substitution ##\frac{s}{2}=u## and ##ds=2du## to compute
$$\Big(2\int^{\frac{2x}{\sqrt{t}}}_0e^{-u^2}du\Big)^2=2\int^{\frac{2x}{\sqrt{t}}}_0e^{-u^2}du2\int^{\frac{2x}{\sqrt{t}}}_0e^{-v^2}dv=4\int^{\frac{2x}{\sqrt{t}}}_0\int^{\frac{2x}{\sqrt{t}}}_0e^{-(u^2+v^2)}dudv$$we consider the function ##e^{-r^2}## on the plane ##R^2## and compute the integral

$$4\int\int_{[0,{\frac{2x}{\sqrt{t}}}]\times[0,{\frac{2x}{\sqrt{t}}}]}e^{-r^2}rdrd\theta$$
we set the boundaries of the integral using ##\theta\in[0,\frac{\pi}{4}]## and ##r\in[0,\frac{2\pi}{\sqrt{t}cos\theta}]## and put a 2 before the integral
$$8\int_0^{\frac{\pi}{4}}\int_0^{\frac{2\pi}{\sqrt{t}cos\theta}} re^{-r^2}drd\theta$$ we make exchanges using ##\clubsuit=-r^2## and ##d\clubsuit=-2rdr## to evaluate the inner integral
Why not just use an ordinary letter instead of a card suit?
docnet said:
$$-\frac{1}{2}\int e^{\clubsuit}d\clubsuit=-\frac{e^\clubsuit}{2}\Rightarrow-\frac{e^{-r^2}}{2}\Rightarrow \frac{1}{2}-\frac{e^{-\frac{4\pi^2}{tcos^2\theta}}}{2}$$giving
$$8\int_0^{\pi/4}\Big[\frac{1}{2}-\frac{e^{-\frac{4\pi^2}{tcos^2\theta}}}{2}\Big]d\theta=\pi+4\int_0^{\pi/4}e^{-\frac{4\pi^2}{tcos^2\theta}}d\theta$$
 
  • Like
Likes   Reactions: Delta2 and docnet
I found an error in the boundary of the inner integral. I am re-evaluating my work now
 
Mark44 said:
Why not just use an ordinary letter instead of a card suit?
I was being unreasonable. i will change it to the letter w in the next attempt.

I cannot get the upper boundary for the inner integral, because i have $$rcos\theta=\frac{2x}{\sqrt{t}}\Rightarrow r=\frac{2rcos\theta}{\sqrt{t}cos\theta}\Rightarrow 1=\frac{2}{\sqrt{t}}$$ so there is a mistake in my work leading up to this point the beginning integral. I will search.
 
If I'm not mistaken, the Gaussian integral, which is a scaled version of the normal distribution function, can not be integrated in closed form, except when the upper limit is ## + \infty ##. That is why look up tables are used when these integrals appear in statistical calculations.
 
  • Like
Likes   Reactions: docnet
docnet said:
I was being unreasonable. i will change it to the letter w in the next attempt.

I cannot get the upper boundary for the inner integral, because i have $$rcos\theta=\frac{2x}{\sqrt{t}}\Rightarrow r=\frac{2rcos\theta}{\sqrt{t}cos\theta}\Rightarrow 1=\frac{2}{\sqrt{t}}$$ so there is a mistake in my work leading up to this point the beginning integral. I will search.
another mistake in post #6 : ##x \neq rcos\theta## because ##u=rcos\theta##. my original work was correct except the upper bounds are ##\frac{x}{2\sqrt{t}}## and I don't know why I made up ##\pi##. maybe i was hungry for pie.

Solution attempt:

we make the substitution ##\frac{s}{2}=u## and ##ds=2du## to compute
$$\Big(2\int^{\frac{x}{2\sqrt{t}}}_0e^{-u^2}du\Big)^2=2\int^{\frac{x}{2\sqrt{t}}}_0e^{-u^2}du2\int^{\frac{2x}{\sqrt{t}}}_0e^{-v^2}dv=4\int^{\frac{x}{2\sqrt{t}}}_0\int^{\frac{x}{2\sqrt{t}}}_0e^{-(u^2+v^2)}dudv$$we consider the function ##e^{-r^2}## on the plane ##R^2## and compute the integral

$$4\int\int_{[0,{\frac{x}{2\sqrt{t}}}]\times[0,{\frac{x}{2\sqrt{t}}}]}e^{-r^2}rdrd\theta$$
we set the boundaries of the integral using ##\theta\in[0,\frac{\pi}{4}]## and ##r\in[0,\frac{x}{2\sqrt{t}cos\theta}]## and put a 2 before the integral
$$8\int_0^{\frac{\pi}{4}}\int_0^{\frac{x}{2\sqrt{t}cos\theta}} re^{-r^2}drd\theta$$ we make exchanges using ##w=-r^2## and ##dw=-2rdr## to evaluate the inner integral

$$-\frac{1}{2}\int e^{w}dw=-\frac{e^w}{2}\Rightarrow-\frac{e^{-r^2}}{2}\Rightarrow \frac{1}{2}-\frac{e^{-\frac{x^2}{4tcos^2\theta}}}{2}$$giving
$$8\int_0^{\pi/4}\Big[\frac{1}{2}-\frac{e^{-\frac{x^2}{4tcos^2\theta}}}{2}\Big]d\theta=\pi+4\int_0^{\pi/4}e^{-\frac{x^2}{4tcos^2\theta}}d\theta\Rightarrow \boxed{\text{unable to evaluate}}$$
 
Last edited:
Charles Link said:
If I'm not mistaken, the Gaussian integral, which is a scaled version of the normal distribution function, can not be integrated in closed form, except when the upper limit is ## + \infty ##. That is why look up tables are used when these integrals appear in statistical calculations.
I did not know this. Is this true? :headbang:
 
  • Like
Likes   Reactions: Charles Link
  • #10
docnet said:
I did not know this. Is this true? :headbang:
I think so, at least according to Wolfram Alpha
 
  • Like
Likes   Reactions: Charles Link
  • #11
I need to find the right integral... commencing search for target.. after i eat this cookie
 
  • Love
Likes   Reactions: Delta2
  • #12
Okay, the correct integral is $$\int^\infty_{-\infty}\frac{1}{2\sqrt{\pi t}}exp(-\frac{(x-y)^2}{4t})y^2dy$$
which is an integral over all of ##R## so this guy is a proper Gaussian integral.

The answer is, by wolfram:
$$x^2+2t$$

What do you people think? What kinds of tips and tricks are there for this one, if any?
 
  • #13
Question: can I integrate this definite integral by "integration by parts" and evaluate the integral (*) over ##R## before substitution?$$\int_R exp\Big(-\frac{(x-y)^2}{4t}\Big)y^2dy$$
integration by parts
$$u=y^2$$
$$du=2y$$
$$dv=exp\Big(-\frac{(x-y)^2}{4t}\Big)$$
(*)$$ v=\int_R exp\Big(-\frac{(x-y)^2}{4t}\Big)dy$$
$$uv-\int vdu\Rightarrow y^2\int_R exp\Big(-\frac{(x-y)^2}{4t}\Big)dy-\int\Big[2y\int_R exp\Big(-\frac{(x-y)^2}{4t}\Big)dy\Big]dy$$

errrr.. maybe no? no.
 
Last edited:
  • #14
The original integral is by definition related to the error function
$$
\operatorname{erf}(x) = \frac{2}{\sqrt \pi} \int_0^x e^{-t^2} dt.
$$
There is no closed form solution in terms of elementary functions.
 
  • Like
Likes   Reactions: Charles Link, Delta2 and docnet
  • #15
@Orodruin See post 12. The OP has now changed the original problem. This one I think can now be readily computed.
 
  • Like
Likes   Reactions: Delta2 and docnet
  • #16
Oh, I missed the updated integral. Yes, it is essentially the solution of the 1D heat equation with initial distribution ##x^2##. It can be relatively easily computed with Feynman's trick, i.e., start by writing down the integral
$$
I(x) = \frac{1}{\sqrt{4\pi t}}\int_{\mathbb R} e^{-\frac{(x-y)^2}{4t}} dy = 1.
$$
Compute the integral expression for ##I''(x) = 0##. This should result in an expression that contains the sought integral with all other integrals being solvable. The result is indeed ##x^2 + 2t##.
 
  • Like
  • Wow
Likes   Reactions: Delta2, docnet and Charles Link
  • #17
An easier way to arrive at the result is to start from the heat equation itself:
$$
u_t(x,t) - u_{xx}(x,t) = 0
$$
with initial condition ##u(x,0) = x^2##. Since this means that ##u_{xx}(x,0) = 2##, it follows that ##u_t(x,0) = 2## for all ##x## and therefore ##u## grows at the same rate everywhere, meaning that the shape, and therefore ##u_{xx}## is preserved for all times ##t##, leading to ##u_t(x,t) = 2## and therefore ##u(x,t) = 2t + u(x,0) = 2t + x^2##.

Interestingly, the result can be generalised to any number of dimensions as long as the initial condition has constant second derivative ##\nabla^2 u = \lambda## for some ##\lambda## (in this case, ##\lambda = 2##).
 
  • Like
  • Wow
Likes   Reactions: Delta2, Charles Link and docnet
  • #18
Orodruin said:
Oh, I missed the updated integral. Yes, it is essentially the solution of the 1D heat equation with initial distribution ##x^2##. It can be relatively easily computed with Feynman's trick, i.e., start by writing down the integral
$$
I(x) = \frac{1}{\sqrt{4\pi t}}\int_{\mathbb R} e^{-\frac{(x-y)^2}{4t}} dy = 1.
$$
Compute the integral expression for ##I''(x) = 0##. This should result in an expression that contains the sought integral with all other integrals being solvable. The result is indeed ##x^2 + 2t##.

Always awes me when someone in PF knows a problem by heart. Thanks! I will impress the TA's with "my" newly acquired knowledge. :bow:
 
  • Like
Likes   Reactions: Delta2
  • #19
docnet said:
Always awes me when someone in PF knows a problem by heart.
Oh, the integral was not by heart ... but Feynman's trick is often very very useful for stuff like this.
I have just seen integral kernel solutions to the heat equation a number of times after teaching it in various forms over a decade and writing a textbook on the subject. :wink:
 
  • Like
Likes   Reactions: Delta2, Charles Link and docnet
  • #20
Orodruin said:
Oh, I missed the updated integral. Yes, it is essentially the solution of the 1D heat equation with initial distribution ##x^2##. It can be relatively easily computed with Feynman's trick, i.e., start by writing down the integral
$$
I(x) = \frac{1}{\sqrt{4\pi t}}\int_{\mathbb R} e^{-\frac{(x-y)^2}{4t}} dy = 1.
$$
Compute the integral expression for ##I''(x) = 0##. This should result in an expression that contains the sought integral with all other integrals being solvable. The result is indeed ##x^2 + 2t##.
not to test your knowledge, but hoping to benefit from it... i'll shamelessly burden you with questions.

how does one know you can derive

$$
\frac{1}{\sqrt{4\pi t}}\int_{\mathbb R} e^{-\frac{(x-y)^2}{4t}}y^2 dy
$$

by differentiating a seemingly random, but similar equation

$$
I(x) = \frac{1}{\sqrt{4\pi t}}\int_{\mathbb R} e^{-\frac{(x-y)^2}{4t}} dy = 1.
$$

w.r.t the variable ##y##?

why does ##I(x)## have to be set to zero, equal to 1 and what is an "integral kernal solution?"
 
  • #21
First, note that the differentiation is with respect to ##x##. The variable ##y## is only a dummy variable and cannot be differentiated with respect to.

I am not setting the integral to one, it is a gaussian standard integral that is equal to one (it can be computed similarly to how you described at first - by squaring the integral and changing to polar coordinates).

How I see that Feynman’s trick might work in some form: The integrand has only the exponential factor that depends on ##x## so differentiating it twice is going to spit out the inner derivative ##(x-y)/2t## twice (plus one term where the inner derivative is differentiated). The square of ##x-y## contains ##y^2## and the expression for ##I''(x)## will therefore contain the sought integral.
 
Last edited:
  • Like
  • Informative
Likes   Reactions: etotheipi, Charles Link, Delta2 and 1 other person
  • #22
@Orodruin mentioned it previously above, and if I'm not mistaken, this gaussian integral is a convolution function for linear response of the way the heat redistributes itself in one dimension, where the ##y^2 ## following the gaussian can be any initial distribution. When that ## y ^2 ## is set instead to unity, (uniform distribution), the heat doesn't redistribute itself but stays at ## I(x,t)=1 ## everywhere for all time ## t ##.

This method for the heat problem was new to me until @Orodruin mentioned it yesterday, after which I googled the topic to read a little more about it.
 
  • Informative
Likes   Reactions: docnet

Similar threads

  • · Replies 105 ·
4
Replies
105
Views
7K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
20
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K