The following verses in the Qur'an say about Mary(P) being the part of Trinity.
And behold! Allah will say: "O Jesus the son of Mary! Didst thou say unto men, 'Take me and my mother for two gods beside Allah'?" He will say: "Glory to Thee! Never could I say what I had no right (to say). Had I said such a thing thou wouldst indeed have known it. Thou knowest what is in my heart, though I know not what in Thine. For Thou knowest in full all that is hidden. [Qur'an 5:116]
O People of the Book! Commit no excesses in your religion: nor say of Allah aught but the truth. Christ Jesus the son of Mary was (no more than) a messenger from Allah, and His Word, which He bestowed on Mary, and a spirit proceeding from Him: so believe in Allah and His Messengers. Say not "Three": desist: It will be better for you: For Allah is One God: Glory be to Him: (Far Exalted is He) above having a son. To Him belong all things in the heavens and on earth. And enough is Allah as a Disposer of affairs. [Qur'an 4:171]
Therefore, some people for quite sometime have been saying that Muhammad(P) 'misunderstood' the true concept of Trinity, i.e, which says the Father, the Son and the Holy Spirit constitute the trinitarian godhead.
Rev. W. St. Clair Tisdall in his book The Original Sources Of The Qur'an says under Muhammad's Misconception Of The Doctrine Of The Trinity.
...Muhammad heard certain Christians make that there are three Gods, that is to say God the Father, Mary, and Jesus. It is perfectly plain from these verses that Muhammad really did believe that the Christian doctrine inculcated belief in three separate Divine persons, Jesus and Mary being two of them. But our third quotation implies that Muhammad - probably from what he had seen of "Christian" worship - thought that the order was Jesus, Mary, God, or Mary, Jesus, God. No reasonable man will wonder at the indignation with which Muhammad in God's name abjures such blasphemy. We must all feel regret that the idolatrous worship offered to Mary led Muhammad to believe that people who called her "Queen of Heaven" and "Mother of God" really attributed to her Divine attributes.[1]
After a bit of Catholic-bashing, Tisdall laments:
Had he been taught that the doctrine of the Unity of God is the very foundation of the Christian faith, he might have become a Christian reformer. He can never have heard the true explanation of the doctrine of Trinity in Unity, otherwise he would have learnt that Christian theologians spoke of the Father not as "the Third of Three" but as the very "Fount of Deity".[2]
It is quite clear that Tisdall is pretty much aware of the famous heresies in Arabia during the advent of Islam. George Sale in the preliminary discourse to his translation of The Koran writes:
But, to be more particular as to the nation we are now writing of, Arabia was of old famous for heresies; which might be in some measure attributed to the liberty and independency of the tribes. Some of the Christians of that nation believed the soul died with the body, and was to be raised again with it at the last day: these Origen is said to have convinced. Among the Arabs it was that the heresies of Ebion, Beryllus, and the Nazareans, and also that of the Collyridians, were broached, or at least propagated; the latter introduced the Virgin Mary for God, or worshipped her as such offering her a sort of twisted cake called collyris, whence the sect had its name.
This notion of the divinity of the Virgin Mary was also believed by some at the Council of Nice, who said there were two gods besides the Father viz. Christ and the virgin Mary, and were thence named Mariamites. Others imagined her to be exempt from humanity, and deified; which goes but little beyond the popish superstition in calling her the complement of the Trinity, as if it were imperfect without her. This foolish imagination is justly condemned in the Koran as idolatrous, and gave a handle to Mohammed to attack the Trinity itself.[3]
Commenting on verse 4:171, George Sale says:
Namely, God, Jesus and Mary. For the eastern writers mention a sect of Christians which held the Trinity to be composed of those three; but it is allowed that this heresy has been long since extinct. The passage, however, is equally levelled against the Holy Trinity, according to the doctrine of the orthodox Christians, who, as Al Beidawi acknowledges, believe the divine nature to consist of three persons, the Father, the Son, and the Holy Ghost; by the Father, understanding God's essence, by the Son, his knowledge, and by the Holy Ghost, his life.[4]
It is pretty clear that whether the 'Holy' Trinity composed of the Father, Jesus(P) and the Mary(P) or the Father, Jesus(P) and the Holy Spirit are equally condemned in the Qur'an. Any association of partners with the God is unacceptable.
Further Edward Gibbon in his book The History of The Decline & Fall Of The Roman Empire says:
The Christians of the seventh century had insensibly relapsed into a semblance of paganism: their public and private vows were addressed to the relics and images that disgraced the temples of the East: the throne of the Almighty was darkened by the clouds of martyrs, and saints, and angels, the objects of popular veneration; and the Collyridian heretics, who flourished in the fruitful soil of Arabia, invested the Virgin Mary with the name and honours of a goddess.[5]
So, there existed a sect in Arabia which exalted Mary(P) to goddess and included her in the godhead along with the Father and Jesus(P).
St. Epiphanius, Bishop of Constantia, in Cyprus, writing in the fourth century against the Collyridians, says:
"After this a heresy appeared, which we have already mentioned slightly by means of the letter written in Arabia about Mary. And this heresy was again made public in Arabia from Thrace and the upper parts of Scythia, and was brought to our ears, which to men of understanding will be found ridiculous and laughable. We will begin to trace it out, and to relate concerning it. It will be judged (to partake of) silliness rather than of sense, as is the case with other like it. For, as formerly, out of insolence towards Mary, those whose opinions were such sowed hurtful ideas in the reflexions of men, so otherwise these, leaning to the other side, fall into the utmost harm...... For the harm is equal in both these heresies, the one belittling the holy Virgin, the other again glorifying her over-much. For who should it be that teach thus but women? for the race of women is slippery, fallible, and humble-minded...... For some women deck out a koutrkon that is to say, a square stool, spreading upon it a linen cloth, on some solemn day of the year, for some days they lay out bread, and offer it in the name of Mary. All the women partake of the bread, as we related in the letter to Arabia, writing partly about that...... Yea, verily, the body of Mary was holy, but was surely not God. Verily, the Virgin was a virgin, and was honoured, but was not given to us to worship; but she worships Him who was born from her according to the flesh, having come from heaven out of the Father's bosom......" This offering and eating of cakes was probably derived from the worship of Artemis.[6]
Apart from the misogynist comments, St. Epiphanius makes quite clear basics of the Collyridian heresy. It is worthwhile adding that even to this day, the Catholic Christians consider Mary(P) as the Mother of God and prayers are sent to her.
Recently, it was heard from some people that the Qur'an does not condemn the 'true' Trinity, i.e., which says the Father, the Son and the Holy Spirit constitute the godhead. In fact, the Qur'an itself condemns all sorts of shirk, i.e., associating partners with Allah. It would not matter if the Trinity was composed of any permutations and combinations of the Father, the Son, the Holy Spirit or the Mary or even Martin Luther King or Calvin or Pope. It would still be considered as associating partners with Allah. The above verse of the Qur'an 4:171, For Allah is One God, is enough to refute any such bizarre argument. It is equally clear even in the Old Testament & The New Testament that the God is one God without any partners.
Ye [are] my witnesses, saith the LORD, and my servant whom I have chosen: that ye may know and believe me, and understand that I [am] he: before me there was no God formed, neither shall there be after me. I, [even] I, [am] the LORD; and beside me [there is] no savior." [Isaiah 43:10-11]
"Hear, O Israel: The LORD our God [is] one LORD" [Deuteronomy 6:4]
"And Jesus answered him, The first of all the commandments is, Hear, O Israel; The Lord our God is one Lord: And thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind, and with all thy strength: this is the first commandment." [Mark 12:29-30]
The above verses speak of themselves.
W. M. Watt ponders in his book Muhammad At Medina:
One of the remarkable features of the relationship between Muslims and Christians is that neither Muhammad nor any of the Companions seems to have been aware of some of the fundamental Christian doctrines. Apart from the reference to the crucifixion (which is primarily a denial of Jewish claim), and the mention of the twelve apostles as the 'helpers' of Jesus, and of the miracles of healing and raising the dead, there is nothing in the Qur'an about the adult life and teaching of Jesus as recorded in the New Testament. The early Muslims gave Jesus the title Messiah (Masih) but did not appreciate that it involved a claim to be 'God's anointed'. They did not understand the distinctive work of Jesus in redeeming the world and atoning for its sins. They did not realize that the Holy Spirit was regarded by Christians as the third person in the Godhead. It is indeed remarkable that there should have been among the Muslims over such a wide area this absence of knowledge of Christianity. The blame for this state of affairs probably rests on those Christians with whom Muhammad and his Companions were in contact, who may themselves have had little appreciation of the doctrines mentioned. Nevertheless the 'absence of knowledge' remains, and in the thirteen centuries since Muhammad's time few Muslims have done anything to fill the lacuna.[7]
It is amazing that even Orientalists like Watt cannot come out of the 'true' Trinitarian doctrine and think of the infamous Christian heresies which were in Arabia during the advent of Islam.
Finally, it is quite clear that the doctrine of Trinity evolved and took its final shape nearly 350 years of CE. But before that:
Christianity in the second and third centuries was in a remarkable state of flux. To be sure, at no point in its history has the religion constituted a monolith. But the diverse manifestations of its first three hundred years - whether in terms of social structures, religious practices, or ideologies - have never been replicated.
Nowhere is this seen more clearly than in the realm of theology. In the second and third centuries there were, of course, Christians who believed in only one God; others, however, claimed that there were two Gods; yet others subscribed to 30, or 365, or more. Some Christians accepted the Hebrew Scriptures as a revelation of the one true God, the sacred possession of all believers; others claimed that the scriptures had been inspired by an evil deity. Some Christians believed that God had created the world and was soon going to redeem it; others said that God neither had created the world nor had ever had any dealings with it. Some Christians believed that Christ was somehow both a man and God; others said that he was a man, but not God; others claimed that he was God but not a man; others insisted that he was a man who had been temporarily inhabited by God. Some Christians believed that Christ's death had brought about the salvation of the world; others claimed that his death had no bearing on salvation; yet others alleged that he had never even died.[8]
So, in conclusion, there is no point calling the modern day trinitarian Christianity as 'true' Christianity and all others as 'false' since the evolution of this doctrine itself is very late. The early Christianity had bizarre beliefs about their doctrine as well as their Scriptures. Moreover the Jesus(P) and early Church Fathers were utterly unaware of this doctrine and they never practiced it. Would then the modern day 'true' Christianity brand them as heretics?
Reference

[1] Rev. W. St. Clair Tisdall, The Original Sources Of The Qur'an, 1905, Society For The Promotion Of Christian Knowledge, London, pp. 180-181.
[2] Ibid, p. 181.
[3] George Sale, The Koran, IX Edition of 1923, J B Lippincott Company, London, p. 25.
[4] Ibid, p. 81
[5] E. Gibbon, The History of The Decline & Fall Of The Roman Empire, 1994, Penguin Books, p. 177.
[6] C. H. H. Wright & C. Neil (Editors), A Protestant Dictionary, 1904, Hodder & Stoughton, London, p. 390 (Under "Mary, The Virgin").
[7] W. M. Watt, Muhammad At Medina, 1956, Oxford At The Clarendon Press, p. 320.
[8] B. D. Ehrman, The Orthdox Corruption Of Scripture: The Effect Of Early Christological Controversies On The Text Of The New Testament, 1993, Oxford University Press, London & New York, p. 3.

by
Mustafa Ahmed & M S M Saifullah