Smooth transition between two lines (2d) I have function that is defined as
$$ Y = \frac{1}{15} x \longrightarrow {\rm if}\qquad 0 \leq x \leq 30 $$
$$ Y = \frac{1}{70} x + \frac{11}{7} \longrightarrow {\rm if}\qquad x > 30 $$
The problem I have is that at $x = 2$, the change between both equations is too sudden. So I'm looking for perhaps a "transition" equation which would smooth the change. 
Thanks 
(sorry about the formulas, I can't get to understand $\LaTeX$)
EDIT: I don't need the actual equation (although it wouldn't hurt me to have it). What I want to learn is actually how can I build such an equation. (my problem is always using to lines)
 A: The old draftsman's approach would be to plot the two lines, then take out a circle template and make it tangent to both of them.  You can do that analytically.  If you pick a radius of circle you want to use, say $r$, then plot two lines $r$ away from the two you have, the center will be at the intersection.  So one line becomes $y=\frac{x}{15}-\frac{r}{\sqrt{1+m^2}}$ with $m=\frac{1}{15}$, and the other becomes $y=\frac{x}{70}+\frac{11}{7}-\frac{r}{\sqrt{1+m^2}}$ with $m=\frac{1}{70}$.  You can then find the intersection of these, call it $(x_0,y_0)$ and that is the center.  Then the circle is $y=\sqrt{r^2-(x-x_0)^2}+y_0$.  The points of tangency are the breakpoints for where to use the circle.
To see the $\LaTeX$, you can right click on any item, pick Show Source, and see it.  Just put it between dollar signs to get it to display.
A: OK, Ross offered you a function that is smooth but not infinitely smooth. I will offer you an infinitely smooth solution - which is moreover more explicit. Let me give you an infinitely smooth interpolation. Define (or recall)
$$ \tanh (a) = \frac{e^a - e^{-a}}{e^a+e^{-a}} $$
This function goes to $\pm 1$ for $a\to\pm\infty$ but is infinitely smooth.
A smooth version of your function may be written as
$$y = \frac{x}{15} + \frac{1+\tanh [K(x-30)]}{2} \left( \frac{x}{70}-\frac{x}{15} + \frac{11}{7} \right) $$
Here, $K\in R^+$ may be chosen arbitrarily. The larger $K$ you choose, the more closely my function will resemble your unsmooth function. The smaller $K$ you will choose, the "smoother" will be my function. But in the technical sense, the function above is infinitely smooth and infinitely differentiable.
Why does it work? For $x<30$ or $x\ll 30$, the factor $(1+\tanh)/2$ goes to zero, so $y$ reduces to the first term, $x/15$, as needed. On the other hand, for $x>30$ or more precisely $x\gg 30$, the factor $(1+\tanh)/2$ goes to $1$, so the parenthesis with the three terms is multiplied by one; $x/15$ gets canceled and you're left with $x/70-11/7$.
Instead of $\tanh a$, you could also use $(2 \arctan (a) / \pi)^3 $ or any other smooth function interpolating between $-1$ and $+1$. I chose the third power here to be sure that it converges to $\pm 1$ quickly enough and the linear factors don't spoil it. For this reason, $\tanh$ is safer.
You might use the method even for more than two pieces. First, merge two of them by the method, and treat is as a function that you may smoothly merge with another function, and so on.
A: Building on @LubosMotl's answer a bit, let's generalize a bit.
(I suspect this is largely the point of the mollifiers mentioned by @Mauro but I didn't find the Wikipedia article very practically useful)
We have two functions, $f$ and $g$ which intersect at some point $x^*$ where WOLG $f'(x^*)<g'(x^*)$, so that (at least locally) $f(x)>g(x),x<x^*$ and vice versa to the right. 
We want a function $h$ which "smooths" $f$ and $g$ together--either we want $h$ to look like $f$ to the right and $g$ to the left of $x^*$ (which I'll focus on below) or the opposite.
To this end, we might consider writing $h$ as the "linear combination" of $f$ and $g$ using weights $\lambda$:
$h(x)=\lambda(x)g(x)+(1-\lambda(x))f(x)$
The appropriate restrictions on $\lambda$ are:


*

*$\lambda(x^*)=\frac{1}{2}$ (so that $h$ passes through $f(x^*)=g(x^*)$)

*$\lim\limits_{x\rightarrow x_L}=1$

*$\lim\limits_{x\rightarrow x_R}=0$

*$\lambda$ monotone decreasing


Where $x_k$ is chosen at some point where we want $h$ to intersect exactly one of the original functions, or set to $\pm \infty$ to approach $f,g$ asymptotically.
The simplest choice is simple linear combinations: $\lambda(x)=\frac{x_R-x}{x_R-x_L}$, but the form also lends itself to $\lambda$ which are symmetric CDFs.
The weighting given by @LubosMotl is just the Logistic CDF, with $\mu=x^*$ and $s=\frac{1}{2K}$ being the scaling parameter--the closer to 0, the narrower the spread of the underlying distribution, and the closer $h$ will be to tracking $f$ and $g$ exactly.
The simplest choice for finite $x_L,x_R$ is probably a symmetric (which requires the parameters are equal) non-central Beta distribution: $\lambda(x;\alpha,x_L,x_R)=\frac{\intop\limits_0^{\frac{x-x_L}{x_R-x_L}} (t(1-t))^{\alpha-1}dt}{\intop_0^1 (t(1-t))^{\alpha-1}dt}$
A quick R simulation to show this in action:
f<-x<-0:10; g<-5; llambda<-function(x,s=1,mu=5){1/(1+exp(-(x-mu)/s))}
h<-function(f,g,l){l*g+(1-l)*f}
h1<-h(f,g,llambda(x,s=1))
h.1<-h(f,g,llambda(x,s=.1))
h10<-h(f,g,llambda(x,s=10))
matplot(x,cbind(f,g,h1,h.1,h10),type="l",
        col=c("black","red","blue","green","orange"),
        ylab="",main="Comparison of Smoothers",lty=c(1,1,2,2,2),lwd=c(3,3,2,2,2))
legend("topleft",legend=c("f","g","h, scale=1","h, scale=.1","h, scale=10"),
       bty="n",col=c("black","red","blue","green","orange"),
       lty=c(1,1,2,2,2),lwd=c(3,3,2,2,2))


A: Also have a look at http://en.wikipedia.org/wiki/Mollifier and http://en.wikipedia.org/wiki/Non-analytic_smooth_function#Smooth_transition_functions
