Find a function that satisfies certain conditions

569 Views Asked by At

Is it possible to find a function with certain conditions?

$$x \gt 0 \Rightarrow f(x) \gt 0$$ $$x = 0 \Rightarrow f(x) = 0$$ $$f'(1)+f'(6)=a \ne 0$$ $$f'(2)+f'(5)=0$$ $$f'(3)+f'(4)=0$$ $$f'(1) \ne 0$$ $$f'(2) \ne 0$$ $$f'(3) \ne 0$$ $$f'(4) \ne 0$$ $$f'(5) \ne 0$$ $$f'(6) \ne 0$$

I don't care how function behaves when $x<0$.

The function as well as its derivative should be continuous.

Possibly, there is some approach to build such function.

Thank you.

5

There are 5 best solutions below

0
On

There is a construction of a smooth function verifying exactly your conditions :

Lemma 1 Let $\varepsilon>0$. There exists a smooth function $g_{\varepsilon}$ such that $$ g_{\varepsilon}(x)\left\{ \begin{aligned} =1 &\quad \text{if} \quad x\leq 0\\ \in (0,1)&\quad \text{if} \quad x\in (0,\varepsilon) \\ =0 & \quad \text{if} \quad x\in [\varepsilon,+\infty) \end{aligned} \right. $$

Proof :

Let $$h(x)=\left\{ \begin{aligned} 0 &\quad \text{if} \quad x\leq 0\\ e^{-\frac1x} & \quad \text{if} \quad x>0 \end{aligned} \right. $$

Then $h$ is a smooth function (proof by induction on $n$ over $h^{(n)}$) strictly increasing for $x>0$.

It is sufficient to define $$ g_{\varepsilon}(x):=\frac{h(h(\varepsilon)-h(x))}{h(h(\varepsilon))}. $$

Remark: $g_{\varepsilon}$ is a smooth approximation of $1_{(-\infty,0]}$.

$ $

Lemma 2
For all $a,b\in \mathbb{R}$ and $\varepsilon>0$, There exists a smooth function $f_{a,b;\varepsilon}$ such that $$f_{a,b;\varepsilon}(x)\left\{ \begin{aligned} =1 &\quad \text{if} \quad x\in [a,b]\\ \in (0,1)&\quad \text{if} \quad x\in (a-\varepsilon,a)\cup (b,b+\varepsilon) \\ =0 & \quad \text{if} \quad x\in (-\infty,a-\varepsilon]\cup [b+\varepsilon,+\infty) \end{aligned} \right. $$

Proof :

Let $g_{\varepsilon}$ define as in Lemma 1. We just have to define $$ f_{a,b;\varepsilon}:= g_{\varepsilon}(-x+a)\times g_{\varepsilon}(x-b)$$

Remark: $f_{a,b;\varepsilon}$ is a smooth approximation of $1_{[a,b]}$.

Main function (for the original question)

$$\boxed{ f(x):=(2|a| +ax)f_{\frac{1}{4}, \frac32+\frac14;\frac14}(x)+f_{\frac{3}{2}, \frac52;\frac14}(x) +f_{\frac{5}{2}, \frac72;\frac14}(x) + f_{\frac{7}{2}, \frac92;\frac14}(x)+ f_{\frac{9}{2}, \frac{11}2;\frac14}(x)+ f_{\frac{11}{2}, \frac{13}2;\frac14}(x)+ g_{\frac14}(-(x-\tfrac{13}2))}$$

Since in particular $f'(1)=a$, $f'(2)=f'(3)=f'(4)=f'(5)=f'(6)=0\ $ and $f(0)=0$, and $f(x)>0$ for $x>0$, you will have indeed $$x \gt 0 \Rightarrow f(x) \gt 0$$ $$x = 0 \Rightarrow f(x) = 0$$ $$f'(1)+f'(6)=a \ne 0$$ $$f'(2)+f'(5)=0$$ $$f'(3)+f'(4)=0$$

Main function (for the actual edited question)

$$\boxed{ \begin{align*} f(x):=& \Big(|a|+\frac{a}{2}x\Big)f_{\frac{1}{4}, \frac32+\frac14;\frac14}(x)+(6-x)f_{\frac{3}{2}, \frac52;\frac14}(x) +(6-x)f_{\frac{5}{2}, \frac72;\frac14}(x)+ xf_{\frac{7}{2}, \frac92;\frac14}(x) \\ &+ xf_{\frac{9}{2}, \frac{11}2;\frac14}(x)+ \Big(6|a|+\frac{a}{2}x\Big)f_{\frac{11}{2}, \frac{13}2;\frac14}(x)+ g_{\frac14}(-(x-\tfrac{13}2)) \end{align*} } $$ Which is a smooth function verifying (since $f'(1)=f'(6)=\frac{a}2$, $f'(2)=f'(3)=-1$, $f'(4)=f'(5)=1$, and we still have $f(x)>0$ for $x>0$ and $f(0)=0$) all the following $$x \gt 0 \Rightarrow f(x) \gt 0$$ $$x = 0 \Rightarrow f(x) = 0$$ $$f'(1)+f'(6)=a \ne 0$$ $$f'(2)+f'(5)=0$$ $$f'(3)+f'(4)=0$$ $$f'(1) \ne 0$$ $$f'(2) \ne 0$$ $$f'(3) \ne 0$$ $$f'(4) \ne 0$$ $$f'(5) \ne 0$$ $$f'(6) \ne 0$$

Is that good for you?

2
On

(The following refers to the state of the question on 03/10/18, 15:00 MEZ.)

We shall first construct the function $g(x):=f'(x)$, whereby we have to distinguish the two cases (i) $a>0$, (ii) $a<0$. The "provisional" functions $$\eqalign{h_1(x)&:=(x-2)(x-3)(x-4)(x-5),\cr h_2(x)&:=(x-2/3)(x-2)(x-3)(x-4)(x-5)(x-19/3)\cr}$$ are symmetric with respect to the vertical $x=3.5$; furthermore $$h_i(2)=h_i(3)=h_i(4)=h_i(5)=0\qquad(1\leq i\leq 2)\ ,$$ $$h_1(1)=h_1(6)>0,\quad h_2(1)=h_2(6)<0\ ,$$ see the following figure.

enter image description here

It follows that the functions $$\eqalign{g_1(x)&:=h_1(x)+10(x-3.5)\cr g_2(x)&:=h_2(x)+10(x-3.5)\cr}$$ satisfy $$g_i(2)=-g_i(5)\ne0,\quad g_i(3)=-g_i(4)\ne0,\quad g_1(1)+g_1(6)>0, \quad g_2(1)+g_2(6)<0\ .$$ For both $g_i$s the function $$f(x):=\int_0^x g_i(t)\>dt$$ satisfies all requirements apart from $f'(1)+f'(6)=a$ for the given $a$. Select the proper $g_i$ according to the sign of $a$ and scale the resulting $f$ by the proper positive factor in order fulfill this last condition as well. The resulting $f$s then look as follows:

enter image description here

6
On

I think it is entirely possible.

What we need is a cubic-like function starting at $(0,0)$, which has a local maximum turning point at $x\in(1,2)$, a local minimum turning point at $x\in(3,4)$ above the $x$-axis and increasing after that.

This is so that

  • the function starts at the origin

  • the function is always above $0$ when $x>0$

  • there are no turning points at $x=1,\cdots,6$ so each of $f'(x)\neq0$ is fulfilled

  • the function is increasing at $x=1$ and $x=6$ so $f'(1)+f'(6)\neq0$.

  • the function is increasing at $x=2$ and decreasing at $x=5$ so given the slopes are the same, we have $f'(2)+f'(5)=0$

  • the function is decreasing at $x=4$ and increasing at $x=5$ so given the slopes are the same, we have $f'(3)+f'(4)=0$

A function that satisfies all but one condition is $$f(x)=x\left(x-7+\frac{\sqrt{46}}2\right)^2$$ The only flaw is that $f'(2)+f'(5)=12\neq0$. For a visualisation see here.

However, I'm sure that there are many other more complicated functions out there that satisfy this criterion as well.

4
On

LAGRANGE INTERPOLALTION POLYNOMIALS


SYNTHESIS OF DERIVATIVE

Let $$d(x) = f'(x).\tag1$$ Using Lagrange interpolation polynomials of $5th$ order with the table $$ \begin{pmatrix} x=&1&2&3&4&5&6\\ d_5(x)=&a/2&b&c&-c&-b&a/2\\ \end{pmatrix},\tag2 $$ where $a\not=0,\ b\not=0,c\not=0,$ one can get

$$d_5(x) = \dfrac{(x-2)(x-3)(x-4)(x-5)(x-6)}{(1-2)(1-3)(1-4)(1-5)(1-6)}\dfrac a2$$ $$+\dfrac{(x-1)(x-3)(x-4)(x-5)(x-6)}{(2-1)(2-3)(2-4)(2-5)(2-6)}b$$ $$+\dfrac{(x-1)(x-2)(x-4)(x-5)(x-6)}{(3-1)(3-2)(3-4)(3-5)(3-6)}c$$ $$+\dfrac{(x-1)(x-2)(x-3)(x-5)(x-6)}{(4-1)(4-2)(4-3)(4-5)(4-6)}(-c)$$ $$+\dfrac{(x-1)(x-2)(x-3)(x-4)(x-6)}{(5-1)(5-2)(5-3)(5-4)(5-6)}(-b)$$ $$+\dfrac{(x-1)(x-2)(x-3)(x-4)(x-5)}{(6-1)(6-2)(6-3)(6-4)(6-5)}\dfrac a2,$$ $$48d_5(x,a,b,c) = (4b-8c)x^5 + (a-70b+140c)x^4+(-14a+464b-912c)x^3 + (71a-1442b+2716c)x^2+(-154a+2052b-3616c)x +120a-1008b+1680c\tag3,$$


ANALYSIS OF THE CONDITIONS

Integration of $(3)$ gives $f(t)$ in the form of $$f_5(x,a,b,c) = \int_0^xd_5(t,a,b,c)dt = \dfrac x{1440}g_5(x,a,b,c),$$ $$g_5(x,a,b,c) = (20b-40c)x^5+(6a-420b+840c)x^4+(-105a+3480b-6840c)x^3+(710a-14420b+27160c)x^2 +(-2310a+30780b-54240c)x + (3600a-30240b+50400c).$$

The issue condition $$x>0 \Rightarrow f(x)>0\tag4$$ can be satisfied only for the non-negative elder coefficient, so $$(b > 2c) \vee ((b=2c) \wedge (a>0)).\tag5$$

Then, must be $g_5(0)>0.$ Note that both of the conditions $d5(0,a,b,c) \ge 0$ and $g_5(0,a,b,c) \ge 0$ reqires $$5a - 42b+70c \ge 0,\tag6,$$ and $(5),(6)$ allow the simple solution $$a>0,\ b=2c \Rightarrow b=\dfrac57a,\ c= \dfrac5{14}a.$$ wherein $$\boxed{f(x,a) = a(x^2 (2130 + 770 x - 435 x^2 + 42 x^3))/10080}\tag7$$ satisfies to the all issue conditions in the case $\mathbf{a>0}$
(see also Wolfram Alpha Plots for $f(x,1),\ f'_x(x,1)$).

Function and derivation

There are a lot of another solutions for $a>0.$ All of them must satisfy constraints $(5),(6)$ and additional control of the abscissa crossing.
Parameter $a=10$ given as the constant and parameters $b, c$ as the columns of the matrix.


CASE $\mathbf{a<0}.$

Using Lagrange interpolation polynomials of $6th$ order with the table $$ \begin{pmatrix} x=&1&2&3&4&5&6\\ h(x)=&1&0&0&0&0&1\\ \end{pmatrix}\tag8 $$ one can get $$h(x) = \dfrac{(x-2)(x-3)(x-4)(x-5)(x-6)}{(1-2)(1-3)(1-4)(1-5)(1-6)}$$ $$+\dfrac{(x-1)(x-2)(x-3)(x-4)(x-5)}{(6-1)(6-2)(6-3)(6-4)(6-5)},$$ $$h(x) = \dfrac1{24}(x-2)(x-3)(x-4)(x-5).$$ Then the function $$\boxed{f(x, -|a|) = f(x,|a|) + 2|a|\int_0^x h^2(x)\,dx}$$ satisfies to the all issue conditions in the case $\mathbf{a<0}.$

Easy to see that Lagrange interpolation polynomials allow to choose various forms of solutions due to the parameters $b,c$ for the given $a$.

At the same time, the interpolation task allows another effective models, as the trig model $$f(x) = \dfrac a2x - \dfrac5{2\pi} \sum_{k=1}^4 c_k \sin \dfrac{\pi k}5x,$$ or the cubic splines.

0
On

(The following applies to the state of the question as of March $12$, $2018$; $11$ am UTC-$6$.)

I'm gonna start with $$g(x)=0.02x^2\big((x-3.5)^2+0.2\big)(7-x)^2.$$ The leading coefficient $0.02$ is just so that $g$ isn't that big on $[0,7]$, while the $+0.2$ in the middle is so that $g(3.5)>0$. Function $g$ is continuous, smooth and symmetrical at $x=3.5$ . However, $g$ is not perfect, since $g'(1)+g'(6)=0$ and $g(7)=0$. As a workabout, I will add to $g$ two gaussian functions that shall act as somewhat-continuous indicator functions, namely $$\exp\left(-\frac{(x-1.1)^2}{0.01}\right) +\exp\left(-\frac{(x-7)^2}{0.01}\right).$$ The first gaussian is for breaking the symmetry around $x=1$; the choice of $1.1$ (which is the peak of the gaussian) is so that the slope at $x=1$ is positive (the slope at the peak is zero). The second gaussian is just for ensuring positiveness around $x=7$. Lastly, I propose this function: $$f(x)= \exp\left(-\frac{(x-1.1)^2}{0.01}\right) +\exp\left(-\frac{(x-7)^2}{0.01}\right) +0.02x^2\big((x-3.5)^2+0.2\big)(7-x)^2.$$ Remarks: $f'(1)+f'(6)\approx 7.3576$ and $f(7)>0$; also, $f$ satisfies most of the OP's desired properties ($a$ who?), specially the part where we don't care how $f$ is for $x<0$. ;-)