If you have the symbolic toolbox, use taylor() on the function expression.
If you do not have the symbolic toolbox, the task can be difficult, depending on the functions you need to be able to handle.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!