How to evaluate derivative in a sequence cmd to create a list for taylor series

BSS_Math shared this question 6 months ago
Answered

Hello,

I am trying to generate a taylor series for a function using the code

L_1=Sequence(Derivative(f, x, k) / k! (x - x_o)^k, k, 0, n, 1)

So, L_1 would generate a list of each piece of the summation of the taylor series up to a value of n specified by the user.

My issue here is that I can't seem to evaluate the derivative at x_o. Is there any cmd in geogebra that allows you to evaluate functions

So for instance if you typed in f'(3) this would evaluate the derivative at 3.

However, if you type Derivative(f, x, k)(3) this multiplies the kth derivative by 3 instead of evaluating it at 3.

I am looking for something like Evaluate(f(x), 3). If this existed then it would solve the issue. I tried guessing some cmds but nothing comes up usable.

I'm sure there should be a simple answer to this. Thank you for your help!

Comments (5)

photo
1

Have you tried this? https://wiki.geogebra.org/e...

photo
1

Hi Michael,

Yes, I am aware of the taylor polynomial. I became aware of it as I was looking at the forums earlier today. However while I can use this command, at this moment in time, I am more interested in learning the Syntax of Geogebra since that enables me to create more robust programs. I find that every time I look into things like this, I learn new and more efficient ways to create programs in geogebra.


One of these days I'm going to challenge myself to generate a program to analyze waves similar to what is done by 3B1B in this video

https://www.youtube.com/wat...


I looked at some available Taylor series programs, and one of the more popular ones had used the spreadsheet to contain each iteration piece of the series, I thought this was interesting and thought it would be interesting to do this using a sequence cmd and generate a list.

photo
photo
1

That's a good question. I also couldn't find a simply way to do that (though I am not that familiar yet with the intricacies of GeoGebra). As a workaround you can use LeftSum:

f(x) = x sin(x)
x_0 = 1
n = 7
Tf(x) = Sum(Sequence(LeftSum(Derivative(f, k), x_0, x_0 + 1, 1) / k! (x - x_0)^k, k, 0, n))


Btw, GeoGebra already has a TaylorPolynomial command.

photo
1

LeftSum( <Function>, <Start x-Value>, <End x-Value>, <Number of Rectangles> )LeftSum(Derivative(f, k), x_o, x_o + 1, 1)

So this is basically evaluating the area of a single rectangle that has a height equal to the kth derivative at x_o and a width of 1.

That's a really interesting work around.

I hope someone might be able to find something a bit more intuitive. I would have never thought of using this leftsum command in this manor.

Cheers.

photo
1

I found another workaround, but I am not sure if is is safe to use:

LDerivatives = Sequence(Derivative(f, x, k), k, 0, n)
Tf(x) = Sum(Sequence(LDerivatives(k + 1, x_0) / k! (x - x_0)^k, k, 0, n))

The idea is to make a list of the derivatives and then use the short notation to access list elements, but with a second parameter x_0. Normally, two parameters (or more) are used to access elements of multidimensional lists (like matrices). The fact that this works for functions the way it does might be completely accidental, not a deliberate feature. Trying to do similar with the Element command (which also allows multiple parameters to access multidimensional lists) doesn't work.

photo
© 2021 International GeoGebra Institute