By the end of Act 3, Gertrude has a much different understanding of what Hamlet has been thinking and why he has been acting the way he has through the play to that point. He makes it abundantly clear that her marriage to Claudius is sinful and a disgrace to King Hamlet and the throne of Denmark. Hamlet even seems to have persuaded her to try and stay away from Claudius. He has also revealed that he is NOT crazy but that it has all been an act. With this realization, Gertrude tries very hard to be on his side. In the very next scene (Act 4, Scene 1) she tells Claudius about Polonius's death, but continues the story that Hamlet did it because he is crazy. She is actively trying to protect her son. She appears to be following through on her new-found knowledge. Much later, at the end of Act 5, just before the fight is to occur, she sends a message to Hamlet to make-up with Laertes and be kind to him. I think she fears for Hamlet, not necessarily knowing the dastardly plan, but perhaps being suspicious of the whole situation. She is hoping that Hamlet's kindness may lesson whatever anger Leartes holds against Hamlet. In the final scene, once she realizes she has drunk from a poisoned cup, she reveals that knowledge to Hamlet in a warning to not drink from that same cup. It is too late to save herself, but her dying words could save Hamlet (but it is sadly too late -- he has already been slashed by the poisoned sword.) Gertrude's actions in Act 4 and 5 make Hamlet feel that he is not as alone and misunderstood as he was before.