i want to calculate the area percentage of a function in a certain regime above a constant threshold. For example:
f[x] = sin[x] x²
from 0 to 2 with a threshold
g(x) = k
If I would do it by hand, I would identify the intersections points between the two functions and than calculate the integrals of the right ones and substract the value of G(x) from F(x) to just get the volume above the threshold. Depending on the number of intersections there quite a number of integrals to consider.
So I thought, let Mathematica do the the leg work! Well, but I am quite a novice in Mathematica, and soon realised that I have only a vague idea how to do it in Mathematica. Probably there is even a better way to do it than described in the middle paragraph, because at the end it could also just approximate the enclosed areas numerically.
Can anyone show me how to do it?
Edit: Thank your very much for your answers/solutions. With a small correction (probably I explained poorly what I wanted) the solution from rasher worked just fine (and I understood the code used). In will also try to learn from Chenminqi solution which looks defintely more sophisticated and exceeds my current mathematica knowledge. So again, thanks to everyone!