i've doubts about this integration

logistic_guy

Full Member
Joined
Apr 17, 2024
Messages
282
here is the question

Evaluate the definite integral \(\displaystyle \int_{0}^{1} \sin x^3 \ dx\) to the indicated accuracy.


my attemps

is it possible to solve integration to 10 decimal places?

my first attemb to use the trigonometric identity \(\displaystyle \sin^3 x = \sin x^3\)

when i use \(\displaystyle x = 0.1, 0.2, 0.3\), they give different values but when i use \(\displaystyle x = 0, 1\) they give the same values. \(\displaystyle 0\) and \(\displaystyle 1\) are the integration limit and their values fit the trigonometric identity

if i solve \(\displaystyle \int_{0}^{1} \sin^3 x \ dx\) how to compare it with \(\displaystyle \int_{0}^{1} \sin x^3 \ dx\) when i don't know the result of the original integration?
 
[math] (\sin x)^3=\sin^3 x \neq \sin x^3=\sin (x^3) [/math]
These two functions are different. Which one do you want to solve? The anti-derivative of [imath] \sin (x^3) [/imath] is complicated. Which algorithms do you know to solve it numerically? [imath] (\sin x)^3 [/imath] can be solved by integration by parts.
 
Evaluate the definite integral \(\displaystyle \int_{0}^{1} \sin x^3 \ dx\) to the indicated accuracy.
...

if i solve \(\displaystyle \int_{0}^{1} \sin^3 x \ dx\) how to compare it with \(\displaystyle \int_{0}^{1} \sin x^3 \ dx\) when i don't know the result of the original integration?
The question as stated is about \(\displaystyle \int_{0}^{1} \sin(x^3) \ dx\). The question at the end compares two different integrals. Is that the rest of the problem as given to you? If not, why do you ask?

The red is [imath]\sin(x^3)[/imath]; the blue is [imath]\sin^3(x)[/imath]:

1726702313372.png

Since [imath]\sin(x^3)>\sin^3(x)>0[/imath] for [imath]0<x<1[/imath], [imath]\int_{0}^{1} \sin^3 x \ dx<\int_{0}^{1} \sin x^3 \ dx[/imath].
 
[math] (\sin x)^3=\sin^3 x \neq \sin x^3=\sin (x^3) [/math]
These two functions are different. Which one do you want to solve? The anti-derivative of [imath] \sin (x^3) [/imath] is complicated. Which algorithms do you know to solve it numerically? [imath] (\sin x)^3 [/imath] can be solved by integration by parts.
thank

i want to solve \(\displaystyle \sin x^3\)

i don't know algorithms. i just read about simpson rule. it's complicated

The question as stated is about \(\displaystyle \int_{0}^{1} \sin(x^3) \ dx\). The question at the end compares two different integrals. Is that the rest of the problem as given to you? If not, why do you ask?

The red is [imath]\sin(x^3)[/imath]; the blue is [imath]\sin^3(x)[/imath]:


Since [imath]\sin(x^3)>\sin^3(x)>0[/imath] for [imath]0<x<1[/imath], [imath]\int_{0}^{1} \sin^3 x \ dx<\int_{0}^{1} \sin x^3 \ dx[/imath].
thank

the question want me only to solve \(\displaystyle \sin x^3\) to 10 decimal places

i ask because \(\displaystyle \sin x^3\) and \(\displaystyle \sin^3 x\) are the same at the begin and end of the integration limit so i thought they give the same solution but i'm not sure and i want to be sure to compare between them
 
the question want me only to solve \(\displaystyle \sin x^3\) to 10 decimal places

i ask because \(\displaystyle \sin x^3\) and \(\displaystyle \sin^3 x\) are the same at the begin and end of the integration limit so i thought they give the same solution but i'm not sure and i want to be sure to compare between them
No, the two functions are not equal at the limits of integration, as is clear in my graph; \(\displaystyle \sin 1^3=\sin 1 = 0.84147...\) and \(\displaystyle \sin^3 1 = (\sin 1)^3 = 0.84147^3=0.59582...\). And that would be irrelevant to accurately working out the definite integral, anyway.

I would expect that whatever source told you to evaluate that integral so accurately has provided some method; I doubt they want you to do it by hand, though. What is the context? And why would you want to do this?
 
No, the two functions are not equal at the limits of integration, as is clear in my graph; \(\displaystyle \sin 1^3=\sin 1 = 0.84147...\) and \(\displaystyle \sin^3 1 = (\sin 1)^3 = 0.84147^3=0.59582...\). And that would be irrelevant to accurately working out the definite integral, anyway.

I would expect that whatever source told you to evaluate that integral so accurately has provided some method; I doubt they want you to do it by hand, though. What is the context? And why would you want to do this?
we're studying complicated functions we can't integrate normally
and we've to figure a way of how to solve them to some given accuracy
they don't give us any method. we're free to use anything but we've to show our steps
i look at Simpson's rule, but i can't use it because it's too complicated
is there another a way to solve this integration to 10 decimal places.
i think even if i'm able to use Simpson rule it can't give this accuracy. am i write?
 
we're studying complicated functions we can't integrate normally
and we've to figure a way of how to solve them to some given accuracy
they don't give us any method. we're free to use anything but we've to show our steps
i look at Simpson's rule, but i can't use it because it's too complicated
is there another a way to solve this integration to 10 decimal places.
i think even if i'm able to use Simpson rule it can't give this accuracy. am i write right?
Who is "we" and "they"? I don't think you've mentioned this context before, that I've seen.

If you want accuracy, you need to use something like Simpson's rule, and the more complicated, the more accurate, in general! I'd try it in a spreadsheet or a program.

Why would you think it can't give such accuracy?
 
Who is "we" and "they"? I don't think you've mentioned this context before, that I've seen.

If you want accuracy, you need to use something like Simpson's rule, and the more complicated, the more accurate, in general! I'd try it in a spreadsheet or a program.

Why would you think it can't give such accuracy?
we student
they teacher

what is spreadsheet and what is is program? do they show the steps of the solution?

i think Simpson don't give the 10 accuracy because it has a special formula to calculate the accuracy

\(\displaystyle \frac{(b - a)^5}{180n^4} [\text{max}|f^{(4)}(x)|]\leq \) accuracy \(\displaystyle = \frac{1}{10^{10}}\)

to get 10 decimal places i need to solve \(\displaystyle n\),

the problem \(\displaystyle [\text{max}|f^{(4)}(x)|] = 0\) for the integration in the original question and i can't solve \(\displaystyle n\) so simpson rule isn't let me know the accuracy
this problem let me think simpson rule won't give me the accuracy i want
 
i'll show you what i do

\(\displaystyle f(x) = \sin x^3\)

\(\displaystyle n = 2\)

\(\displaystyle h = \frac{b - a}{n} = \frac{1 - 0}{2} = \frac{1}{2}\)

\(\displaystyle y_0 = f(0) = 0\)
\(\displaystyle y_1 = f(\frac{1}{2}) = 0.1246747334\)
\(\displaystyle y_2 = f(1) = 0.8414709848\)

\(\displaystyle \int_{0}^{1}\sin x^3 \ dx = \frac{h}{3}[(y_0 + y_2) + 4y_1] = \frac{\frac{1}{2}}{3}[(0 + 0.8414709848) + 4(0.1246747334)] = 0.2233616531\)

\(\displaystyle n = 4\)

\(\displaystyle h = \frac{b - a}{n} = \frac{1 - 0}{4} = \frac{1}{4}\)

\(\displaystyle y_0 = f(0) = 0\)
\(\displaystyle y_1 = f(\frac{1}{4}) = 0.0156243642\)
\(\displaystyle y_2 = f(\frac{2}{4}) = 0.1246747334\)
\(\displaystyle y_3 = f(\frac{3}{4}) = 0.4094717771\)
\(\displaystyle y_4 = f(1) = 0.8414709848\)

\(\displaystyle \int_{0}^{1}\sin x^3 \ dx = \frac{h}{3}[(y_0 + y_4) + 4(y_1 + y_3) + 2y_2] = \frac{\frac{1}{4}}{3}[(0 + 0.8414709848) + 4(0.0156243642 + 0.4094717771) + 2(0.1246747334)] = 0.2326004181\)

\(\displaystyle n = 6\)

\(\displaystyle h = \frac{b - a}{n} = \frac{1 - 0}{6} = \frac{1}{6}\)

\(\displaystyle y_0 = f(0) = 0\)
\(\displaystyle y_1 = f(\frac{1}{6}) = 0.0046296131\)
\(\displaystyle y_2 = f(\frac{2}{6}) = 0.0370285701\)
\(\displaystyle y_3 = f(\frac{3}{6}) = 0.1246747334\)
\(\displaystyle y_4 = f(\frac{4}{6}) = 0.2919799046\)
\(\displaystyle y_5 = f(\frac{5}{6}) = 0.5469391732\)
\(\displaystyle y_6 = f(1) = 0.8414709848\)

\(\displaystyle \int_{0}^{1}\sin x^3 \ dx = \frac{h}{3}[(y_0 + y_6) + 4(y_1 + y_3 + y_5) + 2(y_2 + y_4)] = \frac{\frac{1}{6}}{3}[(0 + 0.8414709848) + 4(0.0046296131 + 0.1246747334 + 0.5469391732) + 2(0.0370285701 + 0.2919799046)] = 0.2335812229\)

i don't know when to stop:(
 
I get [imath] 0.2338452455938166 [/imath] from https://www.integral-calculator.com/ with an error of [imath] \pm 2.596203758573797⋅10^{-15} [/imath]

My first thought was to develop the Taylor series at [imath] x=1 [/imath] and work with the series. But I also know an example ([imath] \tan^{-1} [/imath]) where the series expansion is very, very slow and a trig function formula yields a far better convergence.
 
Last edited:
To use Simpson's rule with an accuracy up to 10 decimal places, you need at least [imath]n = 300[/imath] with an absolute error [imath]\pm 4.3063×10^{-11}[/imath].

No way, you wanna do this by hand. Therefore, here is a quick way to do it:

Let [imath]f(x) = \sin x^3[/imath]

[imath]\displaystyle \int_{0}^{1}f(x) \ dx \approx \frac{h}{3}\left(f(0) + 2\sum_{k=1}^{150-1}f(2hk + 0) + 4\sum_{k=1}^{150}f(h[2k - 1] + 0) + f(1)\right) \approx 0.2338452456[/imath]

where [imath]\displaystyle h = \frac{1 - 0}{n} = \frac{1}{300}[/imath]

Another way is to do it with a Taylor series at [imath]x = 0[/imath]:

[imath]\displaystyle \int_{0}^{1}\sin x^3 \ dx = \sum_{k=0}^{\infty}\frac{(-1)^k}{(6k + 4)(2k + 1)!}[/imath]

With only [imath]k = 5[/imath], you can get an accuracy up to 10 decimal places.

[imath]\displaystyle \int_{0}^{1}\sin x^3 \ dx \approx \sum_{k=0}^{5}\frac{(-1)^k}{(6k + 4)(2k + 1)!} \approx 0.2338452456[/imath]

I get [imath] 0.2338452455938166 [/imath] from https://www.integral-calculator.com/ with an error of [imath] \pm 2.596203758573797⋅10^{-15} [/imath]

My first thought was to develop the Taylor series at [imath] x=1 [/imath] and work with the series. But I also know an example ([imath] \tan^{-1} [/imath]) where the series expansion is very, very slow and a trig function formula yields a far better convergence.
I tried to to do a Taylor series at [imath]x = 1[/imath].

It was Chaos 🤯, so I gave up!
 
I tried to to do a Taylor series at [imath]x = 1[/imath].

It was Chaos 🤯, so I gave up!

Well, it was just an idea I got from the @Dr.Peterson 's plot. I thought the behavior at [imath] x=1 [/imath] would be more "representative". I once came upon the following problem: Use [imath] \tan^{-1}(x)=x- (x^3/3)+(x^5/5)-(x^7/7) \pm \ldots[/imath] and compute [imath] \pi [/imath] up to 100 digits. The result was:

[math]\begin{array}{lll} 4\tan^{-1}(1)=\pi &\text{ needs half a googol terms, } \sim 10^{100} \\ 4\tan^{-1}(1/2)+4\tan^{-1}(1/3)=\pi &\text{ needs }267 \text{ terms }\\ 4\tan^{-1}(1/5)-4\tan^{-1}(1/239)=\pi &\text{ needs }90 \text{ terms } \end{array}[/math]
It seems that integration is tricky even if done numerically. Imagine you would have to code climate or cosmological models!
 
Well, it was just an idea I got from the @Dr.Peterson 's plot. I thought the behavior at [imath] x=1 [/imath] would be more "representative". I once came upon the following problem: Use [imath] \tan^{-1}(x)=x- (x^3/3)+(x^5/5)-(x^7/7) \pm \ldots[/imath] and compute [imath] \pi [/imath] up to 100 digits. The result was:

[math]\begin{array}{lll} 4\tan^{-1}(1)=\pi &\text{ needs half a googol terms, } \sim 10^{100} \\ 4\tan^{-1}(1/2)+4\tan^{-1}(1/3)=\pi &\text{ needs }267 \text{ terms }\\ 4\tan^{-1}(1/5)-4\tan^{-1}(1/239)=\pi &\text{ needs }90 \text{ terms } \end{array}[/math]
It seems that integration is tricky even if done numerically. Imagine you would have to code climate or cosmological models!
It is beautiful to use this trick for a quick convergence.

[imath]4\tan^{-1}(1/2)+4\tan^{-1}(1/3)[/imath] if used with a Taylor series (100 digits accuracy), it will have an absolute error [imath]\pm 5.80489 \times 10^{-100}[/imath], with only 161 terms. Why do you think it needs 267 terms?

And the last one, I think that you have a typo:

[imath]4\tan^{-1}(1/5) - 4\tan^{-1}(1/239) \approx 0.7223557[/imath]
 
It is beautiful to use this trick for a quick convergence.

[imath]4\tan^{-1}(1/2)+4\tan^{-1}(1/3)[/imath] if used with a Taylor series (100 digits accuracy), it will have an absolute error [imath]\pm 5.80489 \times 10^{-100}[/imath], with only 161 terms. Why do you think it needs 267 terms?

And the last one, I think that you have a typo:

[imath]4\tan^{-1}(1/5) - 4\tan^{-1}(1/239) \approx 0.7223557[/imath]
You are right. It should have been [imath] \pi=16\tan^{-1}(1/5)-4\tan^{-1}(1/239). [/imath] The problem statement was about [imath] \pi/4 [/imath] and I forgot a factor 4.

I estimated 164 terms for [imath] \tan^{-1}(1/2) [/imath] and 103 terms for [imath] \tan^{-1}(1/3) [/imath] by using log's. If you are interested in my calculation I could

a) post a screenshot
b) search for my source code and re-code it such that it's compatible with the MathJax version used here
c) link to a pdf download where you can see it - and by the way lots of integral problems with solutions, too, if you are interested (520KB for the pdf with that particular calculation, 2.3MB for the entire text, ~530 pages of problems and solutions)

c) would be easy, a) would cost server space, b) would take some time
 
You are right. It should have been [imath] \pi=16\tan^{-1}(1/5)-4\tan^{-1}(1/239). [/imath] The problem statement was about [imath] \pi/4 [/imath] and I forgot a factor 4.

I estimated 164 terms for [imath] \tan^{-1}(1/2) [/imath] and 103 terms for [imath] \tan^{-1}(1/3) [/imath] by using log's. If you are interested in my calculation I could

a) post a screenshot
b) search for my source code and re-code it such that it's compatible with the MathJax version used here
c) link to a pdf download where you can see it - and by the way lots of integral problems with solutions, too, if you are interested (520KB for the pdf with that particular calculation, 2.3MB for the entire text, ~530 pages of problems and solutions)

c) would be easy, a) would cost server space, b) would take some time
Of course, I am interested. It is very interesting to see these fancy approximations.

I understand the relation between [imath]\displaystyle \frac{1}{2}[/imath] and [imath]\displaystyle\frac{1}{3}[/imath] but I don't understand [imath]\displaystyle\frac{1}{5}[/imath] and [imath]\displaystyle\frac{1}{239}[/imath]

How did you figure out that number [imath]239[/imath]? Are there other numbers to give faster convergence?
 
The download link is https://www.physicsforums.com/threads/solution-manuals-for-the-math-challenges.977057/
and the particular section was Dec. 2020, but if you are interested in a large collection of problems (and solutions) you might want to have a look at the last link which includes all 7 sections in one pdf.

I have found these formulas on Wikipedia: https://de.wikipedia.org/wiki/Arkustangens_und_Arkuskotangens#Berechnung_der_Kreiszahl_π_mit_Hilfe_des_Arkustangens

If you use Google Chrome then you can right-click on the page and translate it into English. The language versions on Wikipedia are not simple translations but are created individually so I don't know whether the corresponding English page mentions John Machin (1706!) as the origin of the formula, too. However, the English page about Machin says it is straightforward https://en.wikipedia.org/wiki/John_Machin and links to https://en.wikipedia.org/wiki/Machin-like_formula#Derivation
 
Last edited:
The download link is https://www.physicsforums.com/threads/solution-manuals-for-the-math-challenges.977057/
and the particular section was Dec. 2020, but if you are interested in a large collection of problems (and solutions) you might want to have a look at the last link which includes all 7 sections in one pdf.

I have found these formulas on Wikipedia: https://de.wikipedia.org/wiki/Arkustangens_und_Arkuskotangens#Berechnung_der_Kreiszahl_π_mit_Hilfe_des_Arkustangens

If you use Google Chrome then you can right-click on the page and translate it into English. The language versions on Wikipedia are not simple translations but are created individually so I don't know whether the corresponding English page mentions John Machin (1706!) as the origin of the formula, too. However, the English page about Machin says it is straightforward https://en.wikipedia.org/wiki/John_Machin and links to https://en.wikipedia.org/wiki/Machin-like_formula#Derivation
I got it, it is the problem number 7 in that December PDF. Don't worry if the Wikipedia is in German as I have read a lot of non-English mathematics articles before and I have understood most of them just by reading the mathematics formulas. The mathematical context does not need an English language.

Thanks a lot professor fresh_42. I think that you have given me 1000 pages to read in the next 5 years before harpazo appears again.

📚
 
I get [imath] 0.2338452455938166 [/imath] from https://www.integral-calculator.com/ with an error of [imath] \pm 2.596203758573797⋅10^{-15} [/imath]

My first thought was to develop the Taylor series at [imath] x=1 [/imath] and work with the series. But I also know an example ([imath] \tan^{-1} [/imath]) where the series expansion is very, very slow and a trig function formula yields a far better convergence.
thank

To use Simpson's rule with an accuracy up to 10 decimal places, you need at least [imath]n = 300[/imath] with an absolute error [imath]\pm 4.3063×10^{-11}[/imath].

No way, you wanna do this by hand. Therefore, here is a quick way to do it:

Let [imath]f(x) = \sin x^3[/imath]

[imath]\displaystyle \int_{0}^{1}f(x) \ dx \approx \frac{h}{3}\left(f(0) + 2\sum_{k=1}^{150-1}f(2hk + 0) + 4\sum_{k=1}^{150}f(h[2k - 1] + 0) + f(1)\right) \approx 0.2338452456[/imath]

where [imath]\displaystyle h = \frac{1 - 0}{n} = \frac{1}{300}[/imath]

Another way is to do it with a Taylor series at [imath]x = 0[/imath]:

[imath]\displaystyle \int_{0}^{1}\sin x^3 \ dx = \sum_{k=0}^{\infty}\frac{(-1)^k}{(6k + 4)(2k + 1)!}[/imath]

With only [imath]k = 5[/imath], you can get an accuracy up to 10 decimal places.

[imath]\displaystyle \int_{0}^{1}\sin x^3 \ dx \approx \sum_{k=0}^{5}\frac{(-1)^k}{(6k + 4)(2k + 1)!} \approx 0.2338452456[/imath]


I tried to to do a Taylor series at [imath]x = 1[/imath].

It was Chaos 🤯, so I gave up!
thank

i appreciate your help🙏
 
Top