Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I was using the symbolic processor to calculate a very simple integration.
| Header 1 | Header 2 | Header 3 | Header 4 | Header 5 |
|---|---|---|---|---|
| Integrate | n.A.cos(n.x) | n.B.sin(n.x) | E.cos(n.x) | F.sin(n.x) |
| MathCad-Definite integral | A.sin(x.n) | 2.B.sin((x.n/2)^2) | (E.sin(x.n))/n | 2.F.sin((x.n/2)^2) |
| Hand/Calculation | A.sin(x.n) | -B.cos(x.n) | E.sin(n.x)/n | -F.cos(n.x)/n |
| Mathcad-Indefinite integral | A.sin(x.n) | -B.cos(x.n) | E.sin(n.x)/n | -F.cos(n.x)/n |
Is it possible to use definite integration only for case where there will be no division by zero. It is easy in this example to do it myself however if the calculation is a bit complicated (and done symblically). Is there a way to tell MathCad use definite integration as long as there is no division by zero.
Example

Solved! Go to Solution.
Chad G. wrote:
I was using the symbolic processor to calculate a very simple integration.
Header 1 Header 2 Header 3 Header 4 Header 5 Integrate n.A.cos(n.x) n.B.sin(n.x) E.cos(n.x) F.sin(n.x) MathCad-Definite integral A.sin(x.n) 2.B.sin((x.n/2)^2) (E.sin(x.n))/n 2.F.sin((x.n/2)^2) Hand/Calculation A.sin(x.n) -B.cos(x.n) E.sin(n.x)/n -F.cos(n.x)/n Mathcad-Indefinite integral A.sin(x.n) -B.cos(x.n) E.sin(n.x)/n -F.cos(n.x)/n
Given that cos(A) = 1-2,sin(A/2)^2, if you are integrating from 0 to x, the definite integral expressions in your table are correct (if a little unexpected!).
Is it possible to use definite integration only for case where there will be no division by zero. It is easy in this example to do it myself however if the calculation is a bit complicated (and done symblically). Is there a way to tell MathCad use definite integration as long as there is no division by zero.
You could use a programmed function to test the value of n and only call the integral (defined earlier as a function) if it is non-zero.
Alan
Chad G. wrote:
I was using the symbolic processor to calculate a very simple integration.
Header 1 Header 2 Header 3 Header 4 Header 5 Integrate n.A.cos(n.x) n.B.sin(n.x) E.cos(n.x) F.sin(n.x) MathCad-Definite integral A.sin(x.n) 2.B.sin((x.n/2)^2) (E.sin(x.n))/n 2.F.sin((x.n/2)^2) Hand/Calculation A.sin(x.n) -B.cos(x.n) E.sin(n.x)/n -F.cos(n.x)/n Mathcad-Indefinite integral A.sin(x.n) -B.cos(x.n) E.sin(n.x)/n -F.cos(n.x)/n
Given that cos(A) = 1-2,sin(A/2)^2, if you are integrating from 0 to x, the definite integral expressions in your table are correct (if a little unexpected!).
Is it possible to use definite integration only for case where there will be no division by zero. It is easy in this example to do it myself however if the calculation is a bit complicated (and done symblically). Is there a way to tell MathCad use definite integration as long as there is no division by zero.
You could use a programmed function to test the value of n and only call the integral (defined earlier as a function) if it is non-zero.
Alan
