some options in R would be
t=seq(0,10,0.01)
y=sin(t)+rnorm(length(t))
plot(t,y,cex=0.1)
# puts a loess smoother through the points
lines(loess.smooth(t,y),col=2)
library(mgcv)
# puts a spline through the points - read Simon Woods work to learn more about this
g<-gam(y~s(t),data=data.frame(t=t,y=y))
lines(t,g$fitted.values,col=3)
and for your recently added data
t=1:400
y=rep(NA,length(t))
y[10]<-30
y[111]<-100
y[171]<-128
y[181]<-86
y[201]<-42
y[211]<-44
y[281]<-39
y[321]<-59
y[341]<-20
y[351]<-4
library(mgcv)
g<-gam(y~s(t),data=data.frame(t=t,y=y))
lm<-predict.gam(g,data.frame(t=t,y=y))
plot(t,y,cex=0.5,pch=16,ylim=c(min(lm),max(lm)))
lines(t,lm,col='red')
The big trick in polynomial interpolation problems uses the function:
$$g(x)=(x-x_1)(x-x_2)\dots(x-x_n)$$
Note that this function is zero at each $x_n$ (and nowhere else). Also, $g'(x)=\sum_{i=1}^n \frac{g(x)}{x-x_i}$ (where the division is intended to cancel out the extra factor, so that it is defined even at each $x_i$).
If I divide $g(x)$ by $g(x^*)$ for some $x^*$ which is not equal to any $x_n$, I get a function that is $1$ at $x^*$ and $0$ at $x_i$. Adding functions of this form multiplied by scalars allows us to solve the problem of finding a polynomial which goes through $x_i,y_i$ (just take $\sum_{i=1}^ny_ig_i(x)$ where $g_i$ is zero for $x_j,j\ne i$ and one at $x_i$).
To get the derivative right at some specified $x^*$, just add to this expression $a\frac{g^*(x)}{{g^*}'(x^*)}$ where $g^*(x)$ is zero at each $x_i$ and at $x^*$; since $g^*(x)$ has a single root at $x^*$ its derivative there is nonzero, so the derivative of this part of the function is $a$, and we can set $a$ to be the desired derivative minus the derivative of the point-interpolation part of the function.
To give an example, let's find a polynomial such that $f(-2)=1$, $f(-1)=0$, $f'(0)=4$, $f(2)=2$. (I just made these numbers up.) First let's ignore the derivative part and construct functions that are zero at two of the points and one at the remaining point:
$$g_1(x)=\frac{(x+1)(x-2)}{(-2+1)(-2-2)}=\frac{x^2-x-2}{4}$$
$$g_2(x)=\frac{(x+2)(x-2)}{(-1+2)(-1-2)}=\frac{-x^2+4}{3}$$
$$g_3(x)=\frac{(x+2)(x+1)}{(2+2)(2+1)}=\frac{x^2+3x+1}{12}$$
Then $h(x)=g_1(x)+0g_2(x)+2g_3(x)=\frac{5x^2+3x-2}{12}$ satisfies $h(-2)=1$, $h(-1)=0$, $h(2)=2$. But it probably has the wrong derivative: $h'(x)=\frac{10x+3}{12}$, so $h'(0)=\frac14$ is not what we want. So let's construct a function which won't affect our other values, but has a nonzero derivative at $0$:
$$g^*(x)=(x+2)(x+1)(x-2)=x^3+x^2-4x-4\implies {g^*}'(x)=3x^2+2x-4$$
So ${g^*}'(0)=-4$. (It is possible for this to come out zero, in which case you can multiply the formula by $x-x^*$ to guarantee nonzero derivative at the expense of a higher degree.) Now the $h$ function is off from what we want by $4-\frac14=\frac{15}4$, while the adjustment function has derivative $-4$, so $-\frac{15}{16}{g^*}(x)$ has derivative $4-\frac14$ at $0$ and $f(x)=h(x)-\frac{15}{16}{g^*}(x)=-\frac{15}{16}x^3-\frac{25}{48}x^2+4x+\frac{43}{12}$ should do the trick.
Best Answer
We want to find $a$ and $b$ such that, say, $y=a\ln(b\,x)$, passes through the given distinct points $(x_1,y_1)$ and $(x_2,y_2)$. This leads to the $2\times 2$ system \begin{align} y_1&=a\ln(b\,x_1),\\ y_2&=a\ln(b\,x_2). \end{align} Solving for $a$ and $b$, we find $$ a={y_1-y_2\over \ln(x_1/x_2)}, \qquad b=\exp\left({y_2\ln(x_1)-y_1\ln(x_2)\over y_1-y_2}\right). $$
You can check that with these value for $a$ and $b$, indeed $y=a\ln(b\,x)$ passes through your two points $(1,150)$ and $(99,300)$.