I found this very informative site that discusses forcing bezier interpolation and the site gives formulae for calculating the control points so that the curve goes through a set of four points, y0, y1, y2 and y3, for t=0, 1/3, 2/3, 1 respectively.
The formulae given on this site are as follows:
P0 = y0
P1 = ( -5 * y0 + 18 * y1 - 9 * y2 + 2 y3 ) / 6
P2 = ( 2 * y0 - 9 * y1 + 18 * y2 - 5 y3 ) / 6
P3 = y3
What I am looking for is a more general form of the formulae for calculating P1 and P2. So instead of having fixed values of t of 1/3 and 2/3, rather to express them as a function of t1 and t2, where t1 is the value of t for point y1 and t2 is the value of t for y3. Can someone please help in deriving these more general formulae?
Without going into the full theoretical background, Bézier curves use a set of polynomials called Bernstein polynomials to weight the points. For a cubic Bézier, which seems to be what your question is about, this results in the parametric definition $$P(t) = (1-t)^3 P_0 + 3t(1-t)^2 P_1 + 3t^2(1-t) P_2 + t^3 P_3$$
When $t = 0$ this gives simply $P(0) = P_0$, and similarly $P(1) = P_3$. So we only have two degrees of freedom in forcing the curve to pass through your intermediate control points. As the site you linked mentioned, we can set up simultaneous equations:
$$\begin{eqnarray*} & P_0 & & & & & = & y_0 \\ (1-t_1)^3 & P_0 & + 3t_1(1-t_1)^2 & P_1 + 3t_1^2(1-t_1) & P_2 + t_1^3 & P_3 & = & y_1 \\ (1-t_2)^3 & P_0 & + 3t_2(1-t_2)^2 & P_1 + 3t_2^2(1-t_2) & P_2 + t_2^3 & P_3 & = & y_2 \\ & & & & & P_3 & = & y_3 \end{eqnarray*}$$
which easily reduce to
$$\begin{eqnarray*}3t_1(1-t_1)^2 & P_1 + 3t_1^2(1-t_1) & P_2 & = & y_1 - (1-t_1)^3 y_0 - t_1^3 y_3 \\ 3t_2(1-t_2)^2 & P_1 + 3t_2^2(1-t_2) & P_2 & = & y_2 - (1-t_2)^3 y_0 - t_2^3 y_3 \end{eqnarray*}$$
I assume you can take it from here.