The two most common ways to evaluate integrals of products are "integration by parts" and "substitution".
I suggest you look them up.
Hello everyone I would like to calculate the following integral using computer (because I have to calculate many of them , in different scenarios).
The integral is of the form
Integrate the
s(x)*g(x) from the interval of [a,b]
First I want to understand how to calculate the multiplication of two function before feeding them into the integral function
Could you please help me with that?
Regards
A
Hello,
I would like to thank you for your answers.
I tried to upload a pretty simplified version of what I want to calculate so to build understanding how integration works in computers.
ImageShack® - Online Photo and Video Hosting
In the image you will see three plots: s(x), g1(x),g2(x)
At the bottom of the image are the two integrals that I would like to find:
s(x)*g1(x)
s(x)*g2(x).
So first I multiply the two functions and then I integrate them?
Then I can see no problem with the multiplication. You have values of f(x) and g(x) at various points- just multiply them together to get f(x)g(x). Yes, you "multiply then then integrate them". That is what " " means!
What integration algorithm are you using, Simpson's rule?
There is a technical difficulty in that one of the functions is a saltus function (a step function), which means that most numerical integration schemes become inefficient. The best policy would be to decompose the integrals into a sum of integrals over the intervals on which the saltus function is a constant.
CB
I would like to thank you for your reply all.
Actually for fun sake I tried numerical integration and if step function has only few steps (like 5-10) I get good results... but when the function has like 800steps then I get errors. thus I would like to ask you for a reference
--> that explain the difference between numerical,analytic/extact integration, and anything else that has to do with calculating integrals in computers.
I will also try the solution Captain Black suggested to decompose the integrals into a sum of integrals and I ll post back again.
Regards and Happy new Year!
Alex
EDIT: One more thing I noticed a step function is not continuous thus can not be integrated. Is that right?
I would like to thank you for your answer.
So to make sure I got it right
a. If you want to integrate a function has to be continuous.
b. If you want to integrate a step function (which is ofc. not continuous) you have to do find the integrals for the smallest step functions.
Do you agree with that?
I would like to thank you in advance for your help
Best Regards
Alex