Changing the ram may work, but the cpu may not be recognized with the new bios. If it works, you'll need to re-use the heatsink the cpu came with, and the connector may not fit on a different board. All you can do is download the motherboard specs and see what info you have before ordering.
Last option, probably best.
On swapping the CPU from an I3-xxx -> I5-xxx (I3-xxxx SB - Not workeee).
The I3 is lower power and the Laptop MB VRs may not provide the added current for an I5 (Should, but no quarrentee). As noted, laptops have a limited bios, and the bios may not support the I5, should, but again no quarrentee.
if there is a model of your samsung with a i5cpu it might work , as long as it fits the socket and it is within power range . I switched a t-7200 for an x-9000 it worked well , went from 2.2 up to 2.9 , runs cooler because the x-9000 although more powerful was smaller die size than the t-7200 . Took all of 20 minutes for the swap .