# Taylor's approximation formula for an IVP and the chain

1. Dec 19, 2012

### atrus_ovis

1. The problem statement, all variables and given/known data
$$f(x,y) = y' = \frac{y+x^2-2}{x+1} , y(0) = 2$$
Write the formula for the 2nd order Taylor approximation

I just want to ask a question

2. Relevant equations
Taylor series

3. The attempt at a solution
Taylor:
$$y(x) = y(x_0) + y'(x_0)(x-x_0) + \frac{y''(x_0)(x-x_0)^2 }{2} = \\ y(x_0) + f(x_0,y_0)(x-x_0) + \frac{f'(x_0,y_0)(x-x_0)}{2} \\$$
To find the derivative , since f is a function of x and y(x) , i have to apply the chain rule and calculate
$$\frac{df}{dx} = \frac{df}{dy}\frac{dy}{dx}$$ , aka calculate the derivative with respect to y and then just multiply by y' = f ?

2. Dec 19, 2012

### Dick

Yes, that's the general idea. But your exact formula is wrong. f is a function of two variables. Suppose f(x,y)=x^2+y^2. Then df/dx=2x+2yy'. If you do df/dy*dy/dx you'll only get 2yy'. Just differentiate with respect to x and then use the chain rule on terms with y's in them.

Last edited: Dec 19, 2012
3. Dec 19, 2012

### atrus_ovis

Ah,that's what i did at first, but it seemed very un-chainruly.
So is this correct?
$$\frac{df}{dx} = \frac{(y+x^2-2)'(x+1) - (y+x^2-2)}{(x+1)^2} \\ = \frac{(f(x,y) + 2x)(x+1) - (y+x^2-2)}{(x+1)^2} = ...\\ ... = \frac{f(x,y)}{(x+1)} + \frac{1-y}{(x+1)^2} +1$$

I can just substitute y' with the quantity given, right?

Also the formula
$$H(x,y)' = H_x + H_y \frac{dy}{dx}$$
works only for H in the form of H(x,y) = f(x)g(y) , from the product rule?

Lastly, how can i add LaTeX without breaking a line from the text?
Like text text LATEXLATEX text text

4. Dec 19, 2012

### Dick

Looks ok. You can substitute y' for f, sure. And df/dx is y''. Is that what you meant? Your formula using the H's should work ok. It's the total differential. It should work for any form of H. It has the term that was missing from df/dy*dy/dx. To get inline tex use 'itex' instead of 'tex'.

Last edited: Dec 19, 2012
5. Dec 20, 2012

### atrus_ovis

6. Dec 20, 2012

### HallsofIvy

Staff Emeritus
I assume the problem specifically says "the 2nd order Taylor approximation around x= 0".

You are given that y(0)= 2 and can easily compute that y'(0)= (2+ 0- 2)/(0+ 1)= 0.
So, for the second order approximation you only need the second derivative. That is, of course, the first derivative of the f(x,y) with respect to x. And I see no reason to differentiate with respect to y.

Use the quotient rule:
y''= [(y'+ 2x)(x+1)- (1)(y+ x^2- 2)]/(x+ 1)^2

At x= 0, y= 2 and y'= 0 so that is
y''= [(0+ 0)(0+ 1)- (1)(0+ 0- 2)]/1= -2.