# Fitting a cosine function to an inflection point and a point with known derivative

1. Oct 30, 2012

I am trying to fit a cosine function to two points knowing that the first is an inflection point (e.g. a trough) and also knowing the gradient at the second. I have a gut feeling this has a unique solution it just needs the right identities and massaging but as of yet I haven't found the way:

Consider a cosine function:

y(x)=A.cos(B.x)+C

and derivative:

y'(x)=B.A.sin(B.x)

and given:

y(0)=Y0
y(X1)=Y1
y'(X1)=DY1

where X1, Y0,Y1 and DY1 are known constants

find the analytical solution for A,B and C

My boundless gratitude to anyone who can solve this.

2. Oct 30, 2012

### Staff: Mentor

Re: Fitting a cosine function to an inflection point and a point with known derivativ

In general, I would expect that your solution is not unique.

Using the inflection point, you know where y''(x1)=0, this will give you several possible values for B. In addition, y(x1)=C fixes C.
For each value of B, you can then calculate the gradient at your second point and solve that for A.