The cost of a laptop is made up of three components:
- Cost of hardware
- Cost of installed software (operating system + applications like MS Office, etc)
- Warranty, extended warranty costs
An open-source Linux-based software should be cheaper but if there is additional hardware like high-end graphics processor, SD drive, larger displays, etc, hardware cost will be more. Also, open source doesnot mean free. Open source only means that source code is available unlike Windows/MS Office/ Adobe etc where you have only the executable, not source code. Red Hat Linux is not free. Open source has costs associated with it – distribution, support costs, etc
If you take an extended warranty on your laptop, it will obviously cost you more and many companies now offer 1 (free) + 2 years extended warranty (paid).
Finally, the brand obviously determines the price.