- #1
fluidistic
Gold Member
- 3,923
- 261
So I've several huge integrals to solve by hands and I would like to check my result with Mathematica. However I don't really know how to do so.
Here is one of the several integrals I must solve:
[tex]\int \frac{1}{2\pi \sigma _x \sigma _y \sqrt{1-\rho ^2 }} \exp \{ \frac{-1}{2(1-\rho ^2)} \left ( \left ( \frac{x-\mu _x}{\sigma _x} \right ) ^2 +\left ( \frac{y-\mu _y}{\sigma _y} \right ) ^2 -\frac{2\rho (x-\mu _x)(y-\mu _y)}{\sigma _x \sigma _y} \right ] \} dx[/tex].
Solving by hands I reached [tex]\frac{1}{\sqrt{2\pi}\sigma _y} \exp \{ \left [ -\frac{1}{2 (1-\rho ^2)} \right ] \left [ \left ( \frac{y-\mu _y }{\sigma _y} \right ) ^2 +\left ( \frac{\mu _x }{\sigma _x} \right ) ^2 + \frac{2 \rho \mu _x y}{\sigma _x \sigma _y} +\frac{\mu _x}{2} +\frac{\rho \sigma _x (y-\mu _y)}{\sigma _y} \right ] \}[/tex].
I want to confirm this result via mathematica, I've tried the following command:
which produced no error.
Then
returned [tex]\int \frac{e^{-\frac{\frac{(x-\text{mu$\_$X}){}^2}{\text{sigma$\_$X}{}^2}+\frac{(y-\text{mu$\_$Y}){}^2}{\text{sigma$\_$Y}{}^2}-\frac{2 \text{rho} (x-\text{mu$\_$X}) (y-\text{mu$\_$Y})}{\text{sigma$\_$X} \text{sigma$\_$Y}}}{2 \left(1-\text{rho}^2\right)}}}{2 \pi \sqrt{1-\text{rho}^2} \text{sigma$\_$X} \text{sigma$\_$Y}} \, dx[/tex]
I've tried "Simplify", "FullSimplify" but the integral is never calculated.
Do you have any idea how to do so? Thanks!
Here is one of the several integrals I must solve:
[tex]\int \frac{1}{2\pi \sigma _x \sigma _y \sqrt{1-\rho ^2 }} \exp \{ \frac{-1}{2(1-\rho ^2)} \left ( \left ( \frac{x-\mu _x}{\sigma _x} \right ) ^2 +\left ( \frac{y-\mu _y}{\sigma _y} \right ) ^2 -\frac{2\rho (x-\mu _x)(y-\mu _y)}{\sigma _x \sigma _y} \right ] \} dx[/tex].
Solving by hands I reached [tex]\frac{1}{\sqrt{2\pi}\sigma _y} \exp \{ \left [ -\frac{1}{2 (1-\rho ^2)} \right ] \left [ \left ( \frac{y-\mu _y }{\sigma _y} \right ) ^2 +\left ( \frac{\mu _x }{\sigma _x} \right ) ^2 + \frac{2 \rho \mu _x y}{\sigma _x \sigma _y} +\frac{\mu _x}{2} +\frac{\rho \sigma _x (y-\mu _y)}{\sigma _y} \right ] \}[/tex].
I want to confirm this result via mathematica, I've tried the following command:
Code:
f[x_,y_]:=1/(2*\[Pi]*sigma_X*sigma_Y*Sqrt[1-rho^2])*E^(-1/(2(1-rho^2))*(((x-mu_X)/sigma_X)^2+((y-mu_Y)/sigma_Y)^2-(2*rho*(x-mu_X)*(y-mu_Y))/(sigma_X*sigma_Y)))
Then
Code:
\[Integral]f[x,y]\[DifferentialD]x
I've tried "Simplify", "FullSimplify" but the integral is never calculated.
Do you have any idea how to do so? Thanks!