Mathematical function for a given graph. I have two hypothetical graphs for which I am trying to get a mathematical function. Are there some suggestions for what mathematical function I can use? I can use piecewise functions.

For this graph, I am using some version of $Exp[-x]$. However, I am not being able to get the zero slope at X =1. Nor am I getting Y = 0 at X =1.

For the second graph, I have tried using the hyperbolic tan function but have not succeeded.
Edit
From reading the comments I understood that it is difficult to get a function which exactly fits my graph. Are there some functions where the slope can be approximately equal to what I am seeking?
 A: What you typically do in these situations is create precisely what you need and then develop it from there. For the first one we use signum or sign function $\operatorname{sgn}(x)$ stationed at $1$. I will explain what I am doing so it is clear.
You need $-x+1$ up to $1$ and then on $y=0$.
Notice that $$\frac{1}{2}(1 \pm \operatorname{sgn}(x))$$
is cutting off left or right side depending on the sign in $1\pm$. We need right side gone after $1$. First we need $\frac{1}{2}(1 - \operatorname{sgn}(x))$ and then we need to shift it by $1$ or
$$\frac{1}{2}(1 - \operatorname{sgn}(x-1))$$
All together the function is
$$f(x)=\frac{1}{2}(1 - \operatorname{sgn}(x-1))(1-x)$$
Now comes the part where you want to have $f'(x)=0$ at $1$. But this is somewhat tricky because if that is the first extreme value, then you have to have another one before reaching $0$ back again. So I have to assume that you need a small positive min at $1$.
Before that if you want a smoother version of $\operatorname{sgn}(x)$ you have quite some options like $\operatorname{sgn}(x)=\frac{x}{\sqrt{x^2+\epsilon}}$ for some small $\epsilon$.
Technically speaking your desired function is this one:
$$f(x)=\lim_{\epsilon \to 0} \frac{1}{2}(1 - \frac{x-1}{\sqrt{(x-1)^2+\epsilon}})(1-x)$$
without that minimum at $1$. You can stay with this one if you want.
Now for the minimum you need a function that is $1$ everywhere except at $0$ where it is $0$. That would be ideal, since we can shift it to $1$ and there we go. Similar to $\operatorname{sgn}(x)$, we could construct such a function, but let us start from something that looks like that. Now a lot of functions can be used instead but this is probably the simplest possible form
$$g(x)=\frac{x^2}{x^2+1}$$
Clear, this function is $0$ at $0$ and somewhere in its vicinity it becomes $1$. If you add $k \gg 1$ it will become as squeezed as you like around $0$.
$$g_k(x)=\frac{kx^2}{kx^2+1}$$
Do not forget that we need it shifted so now the complete function is
$$f_k(x)=\frac{1}{2}(1 - \operatorname{sgn}(x-1))(1-x)\frac{k(x-1)^2}{k(x-1)^2+1}$$
What is nice about this function is that it is smooth regardless of $\operatorname{sgn}(x)$.
Of course, this is a family of functions, but this is because you cannot have $f'(x)=0$ after some point indefinitely and function to be smooth and not constant. So constant $k$ is compensating, it will create a small bump around $1$ which you can regulate.
Notice that your function is $\lim\limits_{k \to \infty} f_k(x)$
Now comes the second function. Well you should be able to do it yourself by now, right?
First part is quite clear
$$f(x)=\frac{1}{2}(1 - \operatorname{sgn}(x-1))(1-\frac{1}{2}x)$$
You need a cut at $1$ and the slope is $-0.5$.
The rest is then the same as above, so in total the change is miniscule:
$$f_k(x)=\frac{1}{2}(1 - \operatorname{sgn}(x-1))(1-\frac1{2}x)\frac{k(x-1)^2}{k(x-1)^2+1}$$
