So can you develop a simple tool to help the students calculate the definite integral? It’s the final challenge in this contest. This task requires many skills and is so challenging that probably only the god can solve it in 5 hours. Can you solve it and become a god-like person?
Next is the format for all functions in this challenge:
There are six types of basic elementary function:
1、 constant function: C;
2、 power function: x^C;
3、 exponential function: e^x;
4、 logarithmic function: ln(x);
5、 trigonometric function: sin(x), cos(x), tan(x), cot(x), sec(x), cot(x);
6、 inverse circular trigonometric function: asin(x), acos(x), atan(x).
C is a constant number between -100 and 100.
Elementary function is basic elementary function and their composite functions. There are ten types of composite functions. (A and B represent elementary functions)
9、 sin(A), cos(A), tan(A), cot(A), sec(A), csc(A);
10、 asin(A), acos(A), atan(A).
Arithmetic priority: () > ^ > *, / > +,-
In this problem, the task can be proper integral, improper integral; it is also possible that its indefinite integral isn’t even an elementary function. But you can assume that, if the integrating range is [a,b], then (a,b) will be a subset of the function’s definitions. You can also assume that for any improper integral, the result of it will converge. Finally, it is guaranteed that the final result is between -10,000 and 10,000.
Each case contains two lines. The first line contains the function f(x) in the format above. There are no more than 300 letters each. There aren’t any whitespaces in the function.
The second line contains two floating numbers, a and b, －10,100 <= a, b <= 10,000 representing the integrating range. Notice that a and b can also be INF, -INF representing ∞ and -∞.
3 x 1 2 sin(x)^2/(sin(x)+cos(x)) 0 1.5707963268 e^(-x) 0 INF
Case 1: 1.500000 Case 2: 0.623225 Case 3: 1.000000