3
$\begingroup$

So I am trying to integrate the function x^2 * Sin^2[n Pi x / a], {x,0,a}. The code I am using is in the "two-dimensional formatting" of mathematica: I am using Esc [] Esc to use the actual integral sign and differential. For example, Esc int Esc gives the integral sign and Esc dd Esc gives the differential. However, whenever I press Shift+Enter, it gives an error. Here is the code when copying the formatting shown in the photo: Subscript[\[Integral], 0]^a[x^2* Sin[n Pi x/a]^2] \[DifferentialD]x

How am I supposed to integrate this way?

formatting shown

$\endgroup$
  • 2
    $\begingroup$ Esc int Esc x^2 * Sin[n * Pi * x/a]^2 Esc dd Esc x Shift Enter (I think your use of [ and ] around your whole expression was the problem, those mean completely different things to Mathematica than ( and ) mean. $\endgroup$ – Bill Aug 31 '16 at 5:34
  • 1
    $\begingroup$ i.e. the square brackets are causing the issue. Your code will run correctly if you delete them. $\endgroup$ – JungHwan Min Aug 31 '16 at 6:05
  • $\begingroup$ The use of Superscript and Subscript described under "Details and Options" of the Integrate documentation appears to be wrong. Instead, follow the fourth example under "Basic Examples" to insert limits on the integral, which works fine (with the outer square brackets removed, of course). $\endgroup$ – bbgodfrey Aug 31 '16 at 6:06
  • $\begingroup$ That isn't the problem. I take them off and error still occurs. I will try that @bbgodfrey, thanks $\endgroup$ – CrypticParadigm Aug 31 '16 at 6:09
  • 2
    $\begingroup$ Try to use Esc+dintt+Esc which will give you the sign of the integral with the slots for the limits. In addition the code x^2 * Sin^2[n Pi x / a] is a syntax error. You need to give it as follows: x^2 * Sin[n Pi x / a]^2. Have fun! $\endgroup$ – Alexei Boulbitch Aug 31 '16 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.