0

I have the following integral which I evaluate analitically

J0[x_, T_] := (E^(-(x^2/(1 + T))) (1 + T - 2 x^2))/(1 + T)^3

FullSimplify[Integrate[y^2 J0[x - y, T], {y, 0, Y}] - 
  Integrate[y^2 J0[x - y, T], {y, -Y, 0}]]

This returns an expression that I display below.

J1[x_, Y_,  T_] := (-((2 Sqrt[\[Pi]] Erf[x/Sqrt[1 + T]])/Sqrt[1 + T]) - (
  Sqrt[\[Pi]] Erf[(-x + Y)/Sqrt[1 + T]])/Sqrt[1 + T] + (
  Sqrt[\[Pi]] Erf[(x + Y)/Sqrt[1 + T]])/Sqrt[1 + T] + (
  4 E^(-((x^2 + Y^2)/(1 + T)))
  Y (-x Y Cosh[(2 x Y)/(1 + T)] + (1 + T + Y^2) Sinh[(2 x Y)/(
  1 + T)]))/(1 + T)^2)/(4 \[Pi])

My question is: I would like to define this expression as the function J1, as I do above, but if I do this directly from the integral definition, every time I call it the program will integrate it again, but this takes some time. How can I do this assignment without copying the result of the integral and manually defining J1?

gypsophila
  • 386
  • 1
  • 11
  • 1
    Use = instead of := and make sure that x, Y and T have no assigned values. – Szabolcs Jul 02 '16 at 13:49
  • Check here in particular: http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/18487#18487 – Szabolcs Jul 02 '16 at 13:50

0 Answers0