Answer
The speed of ship B relative to ship A is $0.75~c$
Work Step by Step
Let $v_{AE}$ be the velocity of ship A relative to Earth. Then $v_{AE} = 0.40~c$ and $v_{EA} = -0.40~c$
Let $v_{BE}$ be the velocity of ship B relative to Earth. Then $v_{BE} = -0.50~c$
We can find $v_{BA}$:
$v_{BA} = \frac{V_{BE}~+~v_{EA}}{1+\frac{(v_{BE})~(v_{EA})}{c^2}}$
$v_{BE} = \frac{(-0.50~c)~+~(-0.40~c)}{1+\frac{(-0.50~c)~(-0.40~c)}{c^2}}$
$v_{BE} = \frac{-0.90~c}{1.20}$
$v_{BE} = -0.75~c$
The velocity of ship B relative to ship A is $-0.75~c$
Therefore, the speed of ship B relative to ship A is $0.75~c$