Mathematica DiracDelta function example from Wolfram documentation

  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Example Function
Click For Summary
The discussion centers on an issue encountered when using the DiracDelta function in Wolfram Cloud for integration. The user attempted to execute the integral of DiracDelta[x] Cos[x] over the range from negative to positive infinity but received an error message indicating "Invalid integration variable or limit(s)." It was discovered that the variable 'x' had been previously assigned a value (3) in the script, which caused the conflict. The resolution involved either clearing the variable 'x' or using a different variable for integration, which successfully resolved the issue.
Swamp Thing
Insights Author
Messages
1,045
Reaction score
775
TL;DR
Example of DiracDelta from the Wolfram Language help doesn't seem to work, at least on Wolfram Cloud.
The page on the Wolfram function DiracDelta has this example:
Code:
Integrate[DiracDelta[x] Cos[x], {x, -Infinity, Infinity}]
It's the first example under Examples > Basic Examples. When I run it in Wolfram Cloud, it says "Invalid integration variable or limit(s) ..."
and shows this result:
1577242349659.png


What's going wrong?

Edit: here's a screenshot:
1577242663222.png
 
Physics news on Phys.org
Have you set x to 3 earlier in your script?
 
  • Wow
Likes Swamp Thing
O... M... G...

Yes, I have, actually :oops:
 
Try clearing x or use another integration variable.
 
Thanks, it works now.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K