How to prolong the abiding in a Brahmavihara? Buddha has encouraged the practisioners to abide in the four Brahmaviharas.(Metta, Karuna, Mudita and Upeksha)
I have experience of Upeksha or Equianimity. After doing sitting meditation both Zazen and Anapana Sati my mind automatically enters into feeling of Equanimity albeit for small duration of 10-15 minutes, I feel calm and tranquil.
However, when I feel Equanimity it seems like its impermenant, the mind changes after sometime. So how do I prolong this feeling of Equanimity?
I've practiced metta by wishing for all beings to be well &amp; happy, happy in the highest sense of the word in particular and thus utterly victorious. I don't do it blandly, i tend to do it in verse and most enthusiasticly.
Basically i hold that the Metta Sutta isn't just a poem but is actually a guided meditation and i train analogically;

This is what should be done
By one who is skilled in goodness,
And who knows the path of peace: ... https://www.accesstoinsight.org/tipitaka/kn/snp/snp.1.08.amar.html

Abhidhamma has this analysis;

And how does a monk dwell with mind accompanied by loving-kindness, suffusing one direction? Just as (he), seeing, may love a lovely, pleasant person; in the same way he suffuses all beings with loving-kindness.
Therein what is loving-kindness? That which in beings is loving, act of loving-kindness, state of loving-kindness, loving-kindness that is mental freedom (from ill-will). This is called loving-kindness. https://suttacentral.net/vb

When settled well in the first jhana i stop contemplating and will rather just sit mindful.

If even for the time of a finger snap, bhikkhus, a bhikkhu pursues a mind of goodwill, he is called a bhikkhu who is not devoid of jhāna, who complies with the Teacher's teaching, who acts according to his instruction, and who does not eat the country’s almsfood in vain. How much more, then, those who practice it frequently! https://www.buddha-vacana.org/sutta/anguttara/01/an01-053.html

As for developing mudita i do it analogically to metta in order to rejoice in the progress of others towards the goal of awakening &amp; good fortunes but mostly towards liberation.
I focus on the good deeds &amp; qualities of the past, those in the here &amp; now and those to be inevitably performed &amp; cultivated in the future.
When cultivating metta i wish for all beings to be successful and when cultivating mudita i rejoice in their progression towards the goal.

And how does a monk dwell with mind accompanied by altruistic joy, suffusing one direction? Just as (he), seeing, may have altruistic joy for a lovely, pleasant person; in the same way he suffuses all beings with altruistic joy.
Therein what is altruistic joy? That which in beings is altruistic joy, act of altruistic joy, state of altruistic joy, altruistic joy that is mental freedom (from jealousy). This is called altruistic joy.

Ie i will think about the beings in various states and that even the hungry ghosts and beings in hell will inevitably leap onward, having payed their debt they too will be merit-makers, of them currently paying their debt &amp; getting reformed and of them having been merit makers in the past.
I think about the virtue of other beings and it is pleasant to think about so one can be happy on that basis. The simile i would give is if you have a child learning to walk and you rejoice in his progress towards the goal.
Similarly to metta i do it well into the first jhana.
Analogically, compassion i practice by perceiving the failures &amp; stumbling of beings along the path to success &amp; victory, the difficulty &amp; crookedness of the path so hard to walk and the road so unforgiving and paved with pain.

And how does a monk dwell with mind accompanied by compassion, suffusing one direction? Just as (he), seeing, may have compassion for a miserable, wicked person; in the same way he suffuses all beings with compassion.
Therein what is compassion? That which in beings is compassion, being compassionate, state of being compassionate, compassion that is mental freedom (from cruelty). This is called compassion.

Compassion is probably the easiest to understand but it is difficult to grasp what is suffering in definitive sense of sankhara-dukkhata;

Monks, there are these three kinds of suffering.[1] What three? Suffering caused by pain,[2] suffering caused by the formations (or conditioned existence),[3] suffering due to change.[4] It is for the full comprehension, clear understanding, ending and abandonment of these three forms of suffering that the Noble Eightfold Path is to be cultivated...&quot; https://www.accesstoinsight.org/tipitaka/sn/sn45/sn45.165.wlsh.html
“Just as even a tiny bit of urine, or spit, or pus, or blood still stinks, so too I don’t approve of even a tiny bit of continued existence, not even as long as a finger snap.” https://suttacentral.net/an1.316-332/en/sujato

When we see the suffering of those who are dear we are moved to help however we can, in particular by helping ourselves in order to help others and to help others in order to help ourselves.
On equanimity

And how does a monk dwell with mind accompanied by equanimity, suffusing one direction? Just as (he) seeing, may have equanimity for a person who is neither pleasant nor unpleasant; in the same way he suffuses all beings with equanimity.
Therein what is equanimity? That which in beings is equanimity, act of equanimity, state of equanimity, equanimity that is mental freedom (from distraction). This is called equanimity.

Equanimity imo is best practiced by seeing others as yourself by focusing on beings being comprised of the 6 elements, with mind-element being illuminous but generally stained by defilements and vision obstructed by dust in the eyes. When one understands the doctrine of self as being untrue, the perception of equanimity is quite easy to attain by practicing in tune with external elements (see mn 62).

&quot;Rahula, develop the meditation in tune with earth. For when you are developing the meditation in tune with earth, agreeable &amp; disagreeable sensory impressions that have arisen will not stay in charge of your mind. Just as when people throw what is clean or unclean on the earth — feces, urine, saliva, pus, or blood — the earth is not horrified, humiliated, or disgusted by it; in the same way, when you are developing the meditation in tune with earth, agreeable &amp; disagreeable sensory impressions that have arisen will not stay in charge of your mind. https://www.accesstoinsight.org/tipitaka/mn/mn.062.than.html

This too one can do well into the first jhana by contemplating and when settled into one can switch to anapanasati to go up and to the fourth jhana based on the air element.
As to how to make the pleasant abidings last longer, it is a trial &amp; error thing. Check this sutta (towards the end) http://www.yellowrobe.com/component/content/article/120-majjhima-nikaya/302-upakkilesa-sutta-imperfections.html