With left truncation of survival times, the idea is that the observation of an event at time $x$ is conditional upon having already survived until left-truncation time $Y_L$. You have no information about any events that might have happened prior to $Y_L$.
Expressing that idea in mathematical form, the contribution to likelihood from an event at time $x$ given left truncation at time $Y_L$ is:
$$L \propto f(x; \theta)/S(Y_L; \theta).$$
Here, $f(x; \theta)$ is the event density function at the event time $x$, $S(t; \theta)$ is the associated survival function, and $\theta$ is the vector of parameter values to be estimated.
So for a left-truncated observation it isn't just $S(Y_L; \theta)$ that you are optimizing, as your question suggests. That's combined with optimizing $f(x; \theta)$ at the observed event time, given that the individual had survived to time $Y_L$. You need to keep both in the likelihood.
drepresents a time of either left truncation or left censoring, it's not clear what you are representing byxin your question or what you mean by "assuming d is constant of x." Left censoring and left truncation are fundamentally different, while the title to the question includes both. The answer depends on which you mean. Please edit the question to provide that information, as comments are easy to overlook and can be deleted. – EdM May 30 '22 at 14:04