I have the following code:
\widetilde{\text{trunc}(\Delta_\mathbf{tot}(X))}
and the output in codecogs is

How Can I do to extend \widetilde? How Can I do to have the following formula:

I have the following code:
\widetilde{\text{trunc}(\Delta_\mathbf{tot}(X))}
and the output in codecogs is

How Can I do to extend \widetilde? How Can I do to have the following formula:

You will need specialist fonts or do it via tikz. IMO it is better to have two syntaxes for this. Use the \widetilde for short expressions, and \somename(trunc...) for long ones. The very wide tilde will become very ugly.
BTW: it is not a good idea to use \text{trunc} as it does not do what you think. Better to use \operatorname{trunc} if it is a one of, or define \trunc via
\DeclareMathOperator\trunc{trunc}
(reason \text{trunc} is italic in an italic context, e.g., the body of a theorem)