## Server Bug Fix: How do you find appropriate trig substitution for \$int frac{sqrt{16x^2 – 9}}{x} , dx\$?

I want to solve the below:

$$int frac{sqrt{16x^2 – 9}}{x} , dx$$

I know for trig substitution, if I have something in the form of $$sqrt{x^2-a^2}$$, I can use $$x = asec{u}$$; it just so happens my integral has a numerator in this form: $$sqrt{16x^2 – 3^2}$$ so I know to use $$x = 3sec u$$:

begin{align} & int frac{sqrt{16x^2 – 9}}{x} , dx \ = {} & int frac{sqrt{16x^2 – 3^2}}{x} , dx \ = {} & int frac{sqrt{16(3sec u)^2 – 3^2}}{3sec u} 3sec utan u , du \ = {} & int frac{(sqrt{16(3sec u)^2 – 3^2)}(3sec utan u)}{3sec u} , du \ = {} & int sqrt{(16(3sec u)^2 – 3^2)}(tan u) , du end{align}

This doesn’t seem to make it easy. However, using a calculator online, it suggests I instead use $$x = dfrac{3}{4}sec{u}$$ which simplifies the integral to a crisp $$int 3tan^2 u , du$$.

My question is, how did the calculator get $$a = dfrac{3}{4}$$ and is there a way to determine an ideal trig substitution for a given function?

In general, if you have $$sqrt{p x^2pm q}$$

1. Make the coefficient $$x$$ equal to $$1$$ by taking coefficient of $$x^2$$ out of square root which gives $$sqrt{px^2pm q}=sqrt psqrt{x^2pm frac{q}{p}}$$
2. Above expression: $$sqrt{x^2pm frac{q}{p}}$$ can be changed into the form: $$sqrt{x^2pm a^2}$$ by equating $$a=sqrt{dfrac{q}{p}}$$

3. Substitute $$x=asec u$$ for the form $$sqrt{x^2-a^2}$$ and $$x=atan u$$ for the form $$sqrt{x^2+a^2}$$

For this case: $$sqrt{16x^2-9}=sqrt{16}sqrt{x^2-frac{9}{16}}$$ $$sqrt{x^2-a^2}=sqrt{x^2-frac{9}{16}}$$
$$implies a=sqrt{frac{9}{16}}=frac34$$

Note: $$sqrt{16x^2-3^2}$$ is a difference of squares. Draw a picture of a right triangle suggested by this: $$4x$$ the hypotenuse, $$3$$ one of the legs (say the side opposite angle $$theta$$), and $$sqrt{16x^2-3^2}$$ the side adjacent to angle $$theta$$.

Do it, don’t just rely on my description.

So then:
$$sintheta = frac{3}{4x}, \ costheta = frac{sqrt{16x^2-3^2}}{4x}, \ tantheta = frac{3}{sqrt{16x^2-3^2}}.$$
Use the simplest one to suggest the substitution:
$$x = frac{3}{4}csc theta, \ dx = -frac{3}{4}cscthetacottheta;dtheta$$
Then substitute back into your integral, looking at your picture to find how to move between $$x$$ and $$theta$$. Here
$$frac{sqrt{16x^2 – 9}}{x} = 4cos theta$$
so we get
begin{align} intfrac{sqrt{16x^2 – 9}}{x};dx &= -int 4cos theta frac{3}{4}cscthetacottheta;dtheta \ &= -3intfrac{cos^2theta}{sin^2theta};dtheta = 3big(cot theta + thetabig)+C end{align}
and then look at the picture to get
$$3big(cot theta + thetabig)+C= 3 left[frac{sqrt{16x^2-3^2}}{3} + arcsinfrac{3}{4x}right]+C$$

this method also works for “sum of squares”. Draw the right triangle
suggested by that particular sum of squares.

$$16x^2 – 9 = 9left( left( tfrac{4x}{3} right)^2 – 1 right) = 9(sec^2theta – 1) = 9tan^2theta.$$

I am confused by the suggestion to use trigonometric substitution, since $$frac{sqrt{16x^2 – 9}}{x} = 16 x frac{sqrt{16x^2 – 9}}{16x^2},$$ and the substitution $$u^2 = 16x^2 – 9, quad 2u , du = 32 x , dx$$ yields begin{align*} int frac{sqrt{16x^2 – 9}}{x} , dx &= int frac{u}{u^2 + 9} u , du \ &= int 1 – frac{9}{u^2 + 9} , du \ &= u – 3 tan^{-1} frac{u}{3} + C \ &= sqrt{16x^2 – 9} – 3 tan^{-1} frac{sqrt{16x^2 – 9}}{3} + C. end{align*}
Trigonometric substitution certainly works, but in such cases, we can certainly avoid it.

Substitute $$sec t= frac43 x$$ to integrate

$$int frac{sqrt{16x^2 – 9}}{x} dx= 3int tan^2tdt= 3int( sec^2t -1)dt = 3tan t -3t+C$$

For such radicals, I find the hyperbolic substitution easier.

With $$dfrac43x=cosh t$$,

$$intfrac{sqrt{16x^2-9}}xdx=3intfrac{sqrt{dfrac{16}9x^2-1}}xdx=3intfrac{sinh^2t}{cosh t}dt=3intfrac{dt}{cosh t}+3intcosh t,dt.$$

Given $$int frac{sqrt{16x^2}-9}{x}dx$$ and that $$sqrt{x^2-a^2} Rightarrow x=a sec theta wedge a sec theta tan theta dtheta =dx$$

Then,

$$int frac{sqrt{16x^2}-9}{x}dx Rightarrow int frac{sqrt{16(3 sectheta)^2}-3^2}{3 sec theta} 3 sec theta tan theta dtheta$$

$$= 12int tan theta sqrt{sec^2 theta}-9$$
$$= 12sqrt {sec^2theta} -81theta +C$$

by factoring out constants and integrating the sum term by term.

First get rid of the annoying factors,

$$intfrac{sqrt{16x^2-9}}xdx=intfrac{sqrt{16left(dfrac{3y}4right)^2-9}}{dfrac{3y}4}ddfrac{3y}4=3intfrac{sqrt{y^2-1}}{y}dy.$$

Then observe the identity

$$left(frac 12left(t+dfrac1tright)right)^2-1=left(frac 12left(t-dfrac1tright)right)^2.$$

Then with $$y=dfrac 12left(t+dfrac1tright)$$ and $$dy=dfrac 12left(1-dfrac1{t^2}right)$$,

$$intfrac{sqrt{y^2-1}}{y}dy=intfrac{dfrac 12left(t-dfrac1tright)}{dfrac 12left(t+dfrac1tright)}dfrac 12left(1-dfrac1{t^2}right)dt=frac12intleft(1+frac1{t^2}-frac{4}{t^2+1}right) dt$$

which is easy.

For this problem, you goal with trig substitution to convert the radical into $$sqrt{a(sec^2 x-1)}$$ which equals $$tan x cdot sqrt{a}$$.

Therefore, let $$x=dfrac{3sec u}{4}$$ so that when $$x$$ is squared in the radical, you’re left with $$sqrt{9left(sec^2 u-1right)}$$.

## Server Bug Fix: Reliability of SSD vs HDD (Over large temperature variations)

I’ve got an application which requires data recording in a outdoor environment, and I am interested in the reliability of SSDs vs HDD when placed in a cold (down to -20) and hot (+50) ambient environments. Intuition leads me to believe SSDs will be more reliable, with the possible exception of high temperatures. Air conditioning enclosures is not an option.

Does anyone have any information on disk reliability in these situations?

Look for an industrial or ruggedized SSD for this application.

A good example of a proper product spec.

``````．Standard 2.5" SATA III SSD, compatible with SATA III/II/I interface
．Capacity: 32GB ~ 256GB
．Data transfer rate: Up to 490 MB/s
．Built-in ECC (Error Correction Code) function
．Support ATA-8 command and SMART function
．Temperature
I.  Operating Temperature: 0℃ ~ +70℃
II. Extended Temperature: -40℃ ~ +85℃
III. Storage Temperature: -55℃ ~ +95℃
``````

Interesting article on the HDD vs SSD at elevated and low temperatures here
https://www.akcp.com/blog/how-temperature-affects-it-data-storage/

SSD’s generally run hotter than HDD, so a lower ambient temperature is probably more beneficial for SSD storage. The hotter the SSD the faster the flash memory will wear out.

The main difference of HDD and SSD is the Storage Capacity and its Related Costs. You can buy SSD supported devices with storage of up to 4 terrabytes, but they come at a cost.An HDD, meanwhile, will give you storage capacity of up to 2 terrabytes on a laptop and 10 terabytes on a desktop.

Yes, there are chips which can work on extreme temperatures (both in cold or warm), but they are much costly. In practice, in most situations it is better (a LOT cheaper) to solve the problem of the temperature stabilisation as to use such electronics.

The temperature between -20 – +50 C isn’t really extreme, especially in case of always working hardware, because its normal ohmical heat will him enough for the normal work. For the higher temp I suggest to use simply air conditioning.

And yes, SSDs are more reliable because they don’t contain moving parts.

Another solution (I don’t know it were applicable in your situation): you could use a simple, minimal embedded hardware which stores its data in a better, protected area, and reaches it with cable network or with wifi.

Tagged : /

## Server Bug Fix: Are there HDDs which tolerate high ambient temperatures?

For certain reasons I won’t go into, I have this small server machine which tends to overheat. I don’t have exact temperature measurements, but let’s say something like…

``````ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022   037   028   045    Old_age   Always   FAILING_NOW 63
``````

Now, I’m probably going to solve the matter differently (move the machine elsewhere, reduce the number of HDDs etc.) – but I was wondering: Can you get Magentic (non-solid-state) HDDs whose acceptable ambient operating temperatures range up to 60 or 70 degree Celsius? If so, can you get them for a bearable price, say, up to twice the price of consumer HDDs?

(I’m not asking for a recommendation of individual products or manufacturers.)

Most systems I’ve seen with this requirement in the past few years use industrial SSDs. But I do have machinery that leverage ruggedized and industrial hard disks as well. The main difference over regular drives being an expanded operating temperature range.

But in order for this not to be an XY Problem question, can you give the context of why the server you have is in such an environment?

There are industrial hard disks that can withstand elevated temperatures.
https://www.westerndigital.com/products/internal-drives/endurastar-series-hdd

Most HDD have throttling when temperatures start to get too high, try to slow down their data rate. Usually around 60°C they begin to throttle, and as the temperature rises they slow down to as low as 1 MB/ps until the drive has cooled again.

SSD’s have a similar feature, and typically they run 10°C higher than a HDD does. So this throttling will be reached much faster. SSD’s require more cooling than HDD do.

Interesting article here about HDD and SSD operating temperatures.
https://www.akcp.com/blog/how-temperature-affects-it-data-storage/

Tagged : /

## Server Bug Fix: Maximum safe hard drive temperature?

I have two new-ish 1TB hard drives in my server, both running at 38 degrees C at the moment. Should I be worried?

38C should be fine. A quick look at some spec sheets shows that operating temperature is 0C to 60C on many models.

You might be interested in section 3.4 of a study done by Google on hard drive failure rates. Temperature is not an issue in drives until they are a few years older, and even then, it seems, it’s not much of an issue under 40C.

What does the manufacturer’s datasheet/documentation have to say about temperature ?

Be careful of the interpretation of your sensors. I have Munin running, and the smartd results shows my drives have “Temperature_Celcius” of around 230.0 (which if true would probably indicate they were on fire) but another probe called “HDD Temperature” records them around 27 and 29 C, which seems much more likely to me.

Slightly OT: If you’re concerned, I find `hddtemp` on Linux indispensable:

`# hddtemp /dev/sdb`

`/dev/sdb: ST9160412AS: 43°C`

You can run it as a daemon or script around it very easily.

HDD can run in a range of 0-60°C, but it is not optimal. They can function with reduced lifespan at either end of these extremes. prolonged exposure under 20°C or above 50°C will cause impairment of the drives useful life. The safest is between 20-45°C. So 38°C is somewhere in this range. 30-32.5°C would be ideal.

One test by national instruments found that a 5C increase could reduce the life by 2 years.

https://www.akcp.com/blog/how-temperature-affects-it-data-storage/

Tagged : /

## Server Bug Fix: How to automatically generate SSL certificates?

How could I automate the generation of SSL certificates for different subdomains? In my workflow, different subdomains ab.mydomain.com, cd.mydomain.com, ab.mynewdomain.com, etc. will point to the IP of my Nginx machine.

I want to generate SSL certificates for these subdomains configured on my Nginx. How could I automate the generation of SSL certificates? Is there a way? Is there any library that can do this for me? I can also start with free SSL certificates, that will not be a problem.

I tried to search this, but could not find any answer.

Admiral Noisy Bottom is right, LetsEncrypt can generate valid certificates for you, and certbot is one of the easiest ways to do that.

You can find certbot instructions here which differ slightly for each platform.

Certbot will make the changes to your nginx configuration for you, if you run:

``````sudo certbot --nginx
``````

You may need to answer some questions the first time you run it, but for future renewals it will be automatic.

(You might want to back up your nginx config first! But I’ve never had a problem with it.)

Don’t forget to follow their instructions at the end of the process, to add a cronjob for automatic renewal.

One mistake I have in the past was to use `crontab -e` instead of creating a file at `/etc/cron.d/certbot`. Adding a line to the crontab can work, but in that case you need to remove the `root` argument from the cron line. It’s easier just to follow their instructions exactly.

Tagged : / / / /

## Server Bug Fix: Need to find a reservation with Delta airlines, scheduled for June 18-June 30

Reservation was made through airline reservations. Charge went through my bank account. The reservation co. sent me an email with a confirmation no., which Delta says is incorrect. Contact air reservations, cant get any info. from them. They said they dont have that info, just check with delta reservations, I did, they said the confirmation no. airline reservations sent to me was incorrect. They cant find this paid for flight, for June 18-30th, unless they can give me an e ticket no. or reservation no. or certificate no. Delta cant find this flight, which is already paid for. How do I find this flight?

Delta should be able to find your flight using your name and the flight numbers and date. If they don’t, than chances are you don’t have an actual reservation. You need to contact the company that took your money.

There are two parts to an airline reservation: a ticket and the reservation itself. The ticket is a (now electronic, formerly paper) document that tells the airline you paid a specific fare to fly a specific route, and is represented by a 13-digit e-ticket number, beginning with the carrier’s 3-digit ticket stock code (in Delta’s case, 006).

The reservation is what holds space on a specific flight for you, and is how the airline knows John Doe would like to fly from JFK to LAX on December 1. This is represented by a six character code known as your Passenger Name Record, or PNR, sometimes also called your confirmation number, confirmation code or record locator.

Usually, when booking a flight, reservation and ticketing happen at the same time, but sometimes a reservation can be created but not ticketed; this is what sounds like happened in this case. Basically, your travel agent collected payment, created a reservation (and thus was able to give you a PNR) but for some reason, did not ticket the reservation. Oftentimes, carriers have rules about how long space can be held without ticketing; likely, Delta automatically cancelled the reservation when they saw you didn’t have a ticket.

Your best bet right now would be to get in touch with the travel agent who originally booked the flight and have them do it over again. Know, however, that since some time has passed, your original flight may not be available at the original fare you paid. Since this is their error, I would demand that they cover any fare difference. If they refuse, demand a refund, or initiate a charge back with your credit card company.

If they are able to get you rebooked, get both the 6-character PNR and your 13-digit e-ticket numbers. And I would recommend only booking directly with airlines whenever possible; if, for some reason, it’s not possible, make sure the travel agency you’re using is a reputable one.

Tagged : / /

## Server Bug Fix: Are all of these police minifigs from LEGO?

While I’m glad LEGO is taking a principled stand on recent events, I’ve seen this set of police minifigs circulating on social media portraying the evolution of LEGO Police through time:

I don’t have any trouble believing the 3 minifigs on the left are legitimate minifigs from LEGO sets, but the fourth one looks much more militaristic than I imagine LEGO would put into a set. Can anyone identify this minifig or confidently rule out it being a LEGO minifig? If anybody wants to identify the first three, that would be cool too.

My first guess was that the long gun was from BrickArms, but I didn’t see anything there that has a scope and a forward handgrip. Can you identify the assault rifle?

As pointed out by others, the first three minifigures are genuine LEGO (with the second having perhaps a few custom accessories). The fourth is not a LEGO minifig. It may include some genuine LEGO elements (legs, hands, etc), but the militaristic accessories are not LEGO elements. This appears to be a custom minifig sold at one time by Modern Brick Warfare.

Not only does LEGO not include guns in their City sets, they also have much better lighting for their minifig photos than this.

These are identified from left to right.

Series 18 of Lego Minifigures has that first policeman. Here is the exact minifigure.

The second one appears to be from Series 9 of Lego Minifigures. Here is the exact minifigure.

The third policeman appears to be LEGO Policeman with Riot Helmet Minifigure with a different head. The head might be Minifigure, Head Male Black Eyebrows, Chin Dimple and Lopsided Grin Pattern – Hollow Stud.

As Alexander O’Mara pointed out, the fourth one is totally not official Lego. It is likely this guy and whoever made the timeline did not bother to think about the excessive military detail in this minifigure (Lego doesn’t even make military content anyways).

Actually, the “timeline” is quite inaccurate. The first policeman being shown was actually released in 2018, however it is most likely a reference to the very first policemen (which look almost identical). Sometimes I mix up the two minifigs by accident, and I suppose the same story goes here (or (s)he probably did it because there are not many good pics of the early police guys y’know). The second and third policemen being shown were released in the same year, 2013. And the fourth one is not even real Lego, so who even knows about when it was made??

## Server Bug Fix: Find the missing shape

Here’s a grid of shapes:

Which of the following shapes should go in the missing cell, and why? There is only one correct answer, and the explanation should not be very complicated.

The missing shape is

the circle.

Reasoning:

In each row the shapes are topologically equivalent.

More formally:

For any two shapes in a given row, there’s a self-homeomorphism on the plane that maps one shape to the other.

From what I can see…

the circle. The first row has 4 outer intersection points and 2 inner intersection points each. The second row has 4 outer intersection points and 4 inner intersection poitns each. the two ont eh third row both have 7 outer intersection points. The first has 4 inner intersection points and the second 5, but that discontinuity goes away if we consider the X in the lower-right-hand corner to be passing by each other and not actually crossing. The circle has 7 outer intersections and 4 inner intersections as well… and is the only one of the options that has an odd number of outer intersection points.

and after the recent edit…

each row is topographically equivalent.

the circle

because

count the number of neighbours each region has. This is the same by row. Equivalently, the number and degree of each vertex, along with the degree of each adjacent vertex, are the same. Corners on the outer border aren’t vertices, unless they are connected to a third edge.

Tagged : / /

## Server Bug Fix: Is the word “psithurism” really used in English?

‎ I have seen people using this word to refer to the sound wind makes as it moves through trees. However,
1. No reputable dictionary seems to have acknowledged this term as a valid english word.
2. Even Google Ngram seems to agree on its oddness.

It appears to be an obsolete rare term.

Fom the OED Online:

Psithurism (rare)

Whispering; a whispering noise, as of leaves moved by the wind.

• 1872 M. COLLINS Pr. Clarice II. xix. 218 Psithurism of multitudinous leaves made ghostly music.

• 1875 Blacksmith & Scholar (1876) II. 12 The wind wooed them with a
whispering psithurism.

Psithurism(plural not attested)

(obsolete) The sound of rustling leaves.

Origin – An adaptation of the Ancient Greek ψιθύρισµα (psithurisma) or ψιθυρισµός (psithurismos), from ψιθυρίζω (psithurizō, “I whisper”), from ψίθυρος (psithuros, “whispering”, “slanderous”).

Tagged : / /

## Server Bug Fix: Response of a system using DFT

Let’s say that we have two sequences, input sequence $$x(n) = [0121]$$ and impulse response of a given system $$h(n) = [0, 1, -1, 1]$$. I need to find response of this system to given input sequence. After that, i need to calculate linear convolution of given sequences.

If we denote the response as $$y(n)$$ we have $$y(n)=h(n)*x(n)$$, which means that, due to convolution theorem, in frequency domain we have $$Y(k)=H(k)X(k)$$. From this, we can find $$y(n) = IDFT(Y(k))$$.

Considering the fact that i need to find convolution of given sequences, meaning $$y(n)=h(n)*x(n)$$, that would mean that it should yield same result as when i was doing this by using DFT. However, my final results don’t match at all.

$$x(n) = [0121] Rightarrow X(k) = [4, -2, 0, -2] \ h(n) = [0, 1, -1, 1] Rightarrow H(k) = [1, 1, -3, 1] \ Y(k)=X(k)H(k) = [4, -2, 0, -2] Rightarrow y(n)=[0, 1, 2, 1]$$

On the other hand, convolution of given sequences gives the following result:

$$y(n) = h(n)*x(n) = [0, 0, 1, 1, 0, 1, 1]$$

Not only that result is completely wrong, but also dimensions of vectors i got as a result are not the same. What am i doing wrong? Any help appreciated!

It will match for circular convolution modulo $$N$$, where $$N$$ is 4 here. For finite length sequences product of DFT of 2 sequences is equivalent to DFT of circular-convolution of the 2 sequences.

``````>> cconv([0,1,2,1], [0,1,-1,1], 4)

ans =

0     1     2     1
``````

``````>>ifft(fft([0,1,2,1]).*fft([0,1,-1,1]))

ans =

0     1     2     1
``````

Tagged : /