Mathematica Mistake? Solve Puzzling Integration Issue

  • Context: Mathematica 
  • Thread starter Thread starter keniwas
  • Start date Start date
  • Tags Tags
    Mathematica Mistake
Click For Summary

Discussion Overview

The discussion revolves around an issue encountered while using Mathematica for integration, specifically regarding the integration of the function (n x + 1)^2. Participants explore the discrepancy between the result obtained from integrating the entire function and the sum of the integrals of its individual components.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant notes that integrating (n x + 1)^2 yields a result that includes a constant term, which is not present when integrating the individual components separately.
  • Another participant explains that the constant term (1/(3n)) is permissible since integration is defined up to a constant, and it does not affect differentiation.
  • A further response questions the rationale behind Mathematica selecting this particular constant, suggesting it seems unusual compared to previous experiences with the software.
  • Another participant clarifies that the constant arises from the application of the chain rule and emphasizes that integration results can differ by a constant without indicating an error.

Areas of Agreement / Disagreement

Participants express differing views on the nature of the constant term in the integration results. While some agree that the presence of the constant is acceptable, others find it unusual and question its significance.

Contextual Notes

The discussion does not resolve the participants' differing perspectives on the appropriateness of the constant term in the integration results, nor does it clarify the implications of not specifying integration boundaries.

keniwas
Messages
57
Reaction score
1
There is something pretty strange going on with mathematica right now.

When I do the following function
Code:
Integrate[(n x + 1)^2,x]

I get the result
[tex]\frac{(1+nx)^3}{3n}[/tex]
Expanded this is
[tex]\frac{1}{3 n}+x+n x^2+\frac{n^2 x^3}{3}[/tex]

However this is not the result I get if I integrate the individual parts of the expansion
[tex](nx+1)^2=1+2nx+n^2x^2[/tex]
and add the results of the integrals
i.e.
Code:
Integrate[n^2 x^2, x] + Integrate[2*n*x, x] + Integrate[1, x]

which gives me
[tex]x+n x^2+\frac{n^2 x^3}{3}[/tex]

Please tell me I am missing somthing obvious and mathematica isn't making a mistake?
 
Physics news on Phys.org
If you integrate w.r.t x, then 1/(3n) is a constant. You have not given integration boundaries, so this is allowed. In other words, since D[1/(3n), x] = 0, both results differentiate back to [itex](nx + 1)^2[/itex].
 
Granted it is allowed, why would it choose such an esoteric constant? Like you said I didn't provide it any boundary conditions, so what's so special about this constant? It seems rather unusal to me, and its not a behavior I have seen from the software before when performing integration that I am aware of.
 
The constant is not particularly esoteric. It is a direct result of applying the chain rule to (n x + 1)^2. In any case, as mentioned above integration is only defined up to a constant, so there is no mistake here other than the fact that the constant is not explicitly mentioned (which I think it should do).
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K