Discrepancy in Calculating Expectation of a Dependent Random Variable Suppose $X$ a is random variable with pdf $$\begin{cases} f(x), & x\ge 0 \\ 0, & x\lt 0 \end{cases} $$ The random variable $Y$ is defined as $$Y= \begin{cases} A, & X\lt k \\ A+BX, & X\ge k \end{cases} $$ where $A,B,k$ are positive constants. If I’m not wrong, the pdf of $Y$ is then $$ \begin{cases} \int_0^k f(x) dx, & y=A \\ f\left(\frac{y-A}{B}\right), & y\gt A \\ 0, & \text{otherwise}\end{cases} $$
as the first case corresponds to $P(X\lt k)$ and the second case corresponds to $P\left(X=\frac{y-A}{B} \right)$, and so $$E(Y)=A\int_0^k f(x) dx \ + \int_A^{\infty} yf\left(\frac{y-A}{B} \right) dy $$
But at the same time, I could also look at this expectation as $$E(Y) = A + B\int_k^{\infty} xf(x) dx $$ as $Y$ will always be a certain amount more than $A$, which depends on $X$.
Which of the two is the correct expression? Am I making a mistake somewhere?
 A: The two methods lead exactly to the same expectation.
Your second expression is
$$ \bbox[5px,border:2px solid red]
{
\mathbb{E}(Y)=A+B\int_k^{\infty} xf_X(x)dx
\qquad (1) 
}
$$
and it is correct!
For the first case, the rv is not absolutely continuous anyway we can derive its CDF (that always exists) in the following way:
$$ F_Y(y) =
\begin{cases}
0,  & \text{if $y<A$ } \\
\int_0^k f_X(x)dx,  & \text{if $y=A$ } \\
F_X\left(\frac{y-A}{B}\right), & \text{if $y\geq A+Bk$}
\end{cases}$$
Thus the expectation is
$$\mathbb{E}(Y)=A\int_0^kf_X(x)dx+\int_{A+Bk}^{\infty}\frac{1}{B}yf_X\left(\frac{y-A}{B}\right)dy$$
Now substitute $\frac{y-A}{B}=x$ and get
$$\mathbb{E}(Y)=A\int_0^kf_X(x)dx+\int_{k}^{\infty}(A+Bx)f_X(x)dx$$
Which is the same as (1)

Here is an useful drawing

As you can see,  Y-domain is X-image thus
$$Y \in A \cup [A+Bk;\infty)$$
A: We can write:$$Y=A+BX1_{[k,\infty)}(X)$$
Then:$$\mathbb EY=\mathbb E\left[A+BX1_{[k,\infty)}(X)\right]=A+B\mathbb EX1_{[k,\infty)}(X)=A+B\int_k^{\infty}xf(x)dx$$
In cases like this it is not handsome to figure out what the PDF (if it exists) of $Y$ looks like.
Actually it is possible here that $Y$ does not even have a PDF. For that note that $P(Y=A)$ might well be  positive. If so then $Y$ is not a continuous random variable (hence has no PDF).
