RE: Computation Contest #5 [2 SBI]

avatar

You are viewing a single comment's thread:

I have a hard time modelling the taylor expansion already :l Just can't figure out the right expressions right now and have other work to do.

Should be doable with two loops, the outer one gives the order of the derivative, the inner one creates all the elements f'(a), f''(a)/2 and so on. The elements are put into a list since they are just constant factors. Integrating is easy and can be done by using the index of the list i. Simply multiply a factor (x-a)^(i+1)/(i+1)to every list element, put borders in there and calculate upper border minus lower border. Put those values into a list and take the sum over all of them to get the result.



0
0
0.000
1 comments
avatar

I will give you a hint regarding the taylor expansion:

You can first find the taylor expansion of e^x and then divide this taylor expansion by x. Then you already have a part of the taylor series and only need to add the taylor series of 1/x.
This is easy, because deriving 1/x can be done easily and exact in the computer in comparison to deriving e^x/x.

0
0
0.000