Mathematica Help: Evaluating Expressions with Integers in Calculus

  • Mathematica
  • Thread starter Dragonfall
  • Start date
  • Tags
    Mathematica
In summary, the conversation discusses a problem with Mathematica evaluating an expression assuming n is an integer. The issue is solved by adding a space between n and x, or by using "Integrate" instead of the symbolic operator. The use of '*' is also recommended to avoid potential problems.
  • #1
Dragonfall
1,030
4
I want mathematica to evaluate a certain expression (see attached) assuming that n is an integer. The answer is far from what it produces. Maple produces the right answer but I don't have access to it.

The expression is

[tex]\frac{\int_{-\pi}^{\pi}|\sin(x)|\cos(nx)\dx}{\int_{-\pi}^{\pi}\cos^2(nx)\dx}[/tex]
 

Attachments

  • Picture 1.png
    Picture 1.png
    1.2 KB · Views: 406
Last edited:
Physics news on Phys.org
  • #2
You need to put a space between your n and x. Mathematica is treating nx as a single variable, which explains the funky result.
 
  • #3
One other thing to try...I don't have Mathematica in front of me here at work, but I do remember also reading an article about Mathematica getting into a bit of trouble in some cases when using the sybolic integration sign. If Stephan's tip doesn't help, you may try using "Integrate" instead of the symbolic operator.
 
  • #4
Use '*' everywhere, to avoid possible problems. Doesn't look nice, though, but nevermind.
 
  • #5
The error was the missing *. Thanks for the help.
 
  • #6
Dragonfall said:
The error was the missing *. Thanks for the help.

Yes. But note that, as someone above stated, you can simply use the space bar instead of '*'. Mathematica will produce a small space between the two object that are multiplied.
 

1. What is Mathematica Help?

Mathematica Help is an online resource provided by the Wolfram company for users of their software, Mathematica. It contains documentation, tutorials, and examples to help users learn about and use the features of Mathematica.

2. How can I access Mathematica Help?

Mathematica Help can be accessed through the "Help" menu within the Mathematica software. It can also be accessed through the Wolfram website, where users can search for specific topics or browse through the available documentation.

3. What types of information can I find in Mathematica Help?

Mathematica Help contains a variety of information, including detailed descriptions of functions and their syntax, examples of code, and explanations of concepts and techniques. It also includes links to additional resources, such as tutorials and videos, to help users further their understanding.

4. Can I contribute to Mathematica Help?

Yes, users can contribute to Mathematica Help by submitting feedback or suggestions for improvements. However, the content of Mathematica Help is carefully curated by the Wolfram team, so not all suggestions may be incorporated.

5. Is there a cost to access Mathematica Help?

No, access to Mathematica Help is free for all users. However, to access all features and resources of Mathematica, a license or subscription may be required.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Replies
4
Views
305
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
11
Views
327
  • Topology and Analysis
Replies
4
Views
255
  • Introductory Physics Homework Help
Replies
28
Views
348
  • Calculus
Replies
29
Views
679
  • Calculus and Beyond Homework Help
Replies
5
Views
665
Replies
3
Views
1K
Back
Top