sampling distribution using normal and rectangular distribution Let $X_1,X_2$ be i.i.d. $N(0,1)$  and $U_1,U_2$ be i.i.d. $U(0,1)$ and independent of $X_1,X_2$.  Define $$Z_1=\frac{(X_{1}U_{1}+X_{2}U_{2})}{\sqrt{U_{1}^2+U_{2}^2}}.$$ Find the distribution of $Z$. 
 Answer: $$Z_1=\frac{(X_{1}U_{1}+X_{2}U_{2})}{\sqrt{U_{1}^2+U_{2}^2}}\stackrel{d}{=}\frac{(X_{1}+X_{2})U_{1}}{\sqrt{2U_{1}^2}}\stackrel{d}{=}\frac{X_{1}+X_{2}}{\sqrt2}\sim N(0,1).$$
But if we proceed one step further, then
$\frac{X_{1}+X_{2}}{\sqrt2}\stackrel{d}{=}\frac{2X_{1}}{\sqrt2}\sim N(0,2).$
Which is correct?
 A: It appears $Z\sim N(0,1)$. See first figure below.  
Further, $X_1+X_2 \stackrel{d}{\ne} 2X_1$, where $\stackrel{d}{\ne}$ means not equal in distribution. See second figure below.


Added figure:  $X_1+X_2 \stackrel{d}{\ne} 2X_1$.

MATLAB Code
% MATLAB R2018a 
n = 50000;
U1 = rand(n,1);
U2 = rand(n,1);
X1 = normrnd(0,1,n,1);
X2 = normrnd(0,1,n,1);
Z = ((X1.*U1)+(X2.*U2))./sqrt((U1.^2)+(U2.^2));   

pd1 = makedist('Normal',0,1);
pd2 = makedist('Normal',0,2);

figure, hold on, box on
title('Empirical Distribution of Z (50000 samples)')
histogram(Z,'Normalization','pdf','DisplayName','Z')
XAxis = get(gca,'XTick');
XSupport = -5:0.1:5;
plot(XSupport,pdf(pd1,XSupport),'b-','LineWidth',1.7,'DisplayName','N(0,1)')
plot(XSupport,pdf(pd2,XSupport),'r-','LineWidth',1.7,'DisplayName','N(0,2)')
xlim([-5 5])
ylabel('PDF')
legend('show','Location','northeast')

% Edit: Added second test
    Y = X1+X2;
    W = 2*X1;
   figure, hold on, box on
   title('Empirical Distribution of (X_1+X_2) and 2X_1 (50000 samples)')
   histogram(Y,'Normalization','pdf','DisplayName','X_1+X_2')
   histogram(W,'Normalization','pdf','DisplayName','2X_1')
   XAxis = get(gca,'XTick');
   XSupport = -8:0.1:8;
   plot(XSupport,pdf(pd2,XSupport),'r-','LineWidth',1.7,'DisplayName','N(0,2)')
   xlim([-8 8])
   ylabel('PDF')
   legend('show','Location','northeast')

